Hi Minesh, thank you again.
I made test form submissions and unfortunately, I couldn't submit a form with .dcm file.
I got an error message "Error some required upload field failed" even though all fields were filled. Please see the HTML element with this message below. Form submissions with other file types were successful.
<div id="lbl_Post Title" class="wpt-form-error alert alert-danger">Error some required upload field failed.</div>
Also, I see PHP warning message during a try of form submission with .dcm file:
Warning: Illegal string offset 'upload_fail' in /wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/Form_Builder_Helper.php on line 1907
Warning: Illegal string offset 'label' in /wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/Form_Builder_Helper.php on line 1911
Notice: Object of class WP_Error could not be converted to int in /wp-content/plugins/cred-frontend-editor/application/controllers/notification_manager/post.php on line 229
Notice: Object of class WP_Error could not be converted to int in /radiologyportal/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/models/Forms.php on line 365
Warning: Illegal offset type in /radiologyportal/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/models/Forms.php on line 365
Warning: Illegal offset type in /radiologyportal/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/models/Forms.php on line 368
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
That is really strange. That is why I will require the same file you are trying to upload.
Can you please upload the file that you are trying to upload on any file sharing service and send me link to download it and let me review whats going wrong.
I have set the next reply to private which means only you and I have access to it.
Sure, Minesh. Here are two files I downloaded as sample files and which I used for test form submissions: hidden link
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
The issue was with your file extension.
The files you are trying to upload is with .DCM (in capital letters) and the files I try to upload is with .dcm (small letter) and we added the mime type for the .dcm not for .DCM.
So I've adjusted the code as given under for the upload_mimes to the "Custom Code" seciton:
add_filter( 'upload_mimes', 'func_allow_dcm_file_uploads' );
function func_allow_dcm_file_uploads( $mimes ) {
$mimes['DCM'] = 'application/dicom';
$mimes['dcm'] = 'application/dicom';
return $mimes;
}
Where as you may notice we allow the DCM now.
Can you please check now I hope this time you should be able to mark resolve this ticket. You may add different message like "This issue is really resolved" or any other message you would like as you will not be able to mark resolve this ticket with the same text.
Fantastic! Thank you, Minesh. Now everything works perfectly fine.