Hello, since upgrading to V2, I have been experiencing issues with uploading files.
PHP 8.4.14 (upload_max_filesize: 8 M) + MODX 3.12-pl + FormIt 5.1.1-pl + AjaxUpload 2.0.4-pl
My test file is 422 KB in size. Could my configuration be incorrect?
Does anyone have a solution or tip for this?
I see that in the HTML source (sorry, the original is in German and I’m trying to translate it):
<script>
FilePond.registerPlugin(
FilePondPluginFileValidateType,
FilePondPluginFileValidateSize,
FilePondPluginImagePreview
);
FilePond.create(document.querySelector('#filepond-attachWeb'), {
name: 'attachWeb[]',
server: {
url: '/assets/components/ajaxupload/connector.php',
process: '?uid=attachWeb&action=process',
patch: '?uid=attachWeb&action=patch',
revert: '?uid=attachWeb&action=revert',
fetch: '?uid=attachWeb&action=fetch',
restore: '?uid=attachWeb&action=restore&id=',
load: '?uid=attachWeb&action=load',
},
chunkUploads: true,
credits: [],
acceptedFileTypes: ["image/jpeg","image/gif","image/png","image/webp","application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
maxFiles: "4",
maxFileSize: "8MB",
files: [],
labelIdle: 'Drop files or <span class="filepond--label-action"> select </span>',
labelInvalidField: 'Field contains invalid files',
labelFileWaitingForSize: 'Calculating file size',
labelFileSizeNotAvailable: 'File size not available',
labelFileLoading: 'Loading',
labelFileLoadError: 'Error while loading',
labelFileProcessing: 'Upload in progress',
labelFileProcessingComplete: 'Upload complete',
labelFileProcessingAborted: 'Upload aborted',
labelFileProcessingError: 'Error during upload',
labelFileProcessingRevertError: 'Error while restoring',
labelFileRemoveError: 'Error while deleting',
labelTapToCancel: 'cancel',
labelTapToRetry: 'retry',
labelTapToUndo: 'undo',
labelButtonRemoveItem: 'Remove',
labelButtonAbortItemLoad: 'Discard',
labelButtonRetryItemLoad: 'Retry',
labelButtonAbortItemProcessing: 'Cancel',
labelButtonUndoItemProcessing: 'Undo',
labelButtonRetryItemProcessing: 'Retry',
labelButtonProcessItem: 'Upload',
labelMaxFileSizeExceeded: 'File is too large',
labelMaxFileSize: 'Maximum file size: {filesize}',
labelMaxTotalFileSizeExceeded: 'Maximum total file size exceeded',
labelMaxTotalFileSize: 'Maximum total file size: {filesize}',
labelFileTypeNotAllowed: 'Invalid file type',
fileValidateTypeLabelExpectedTypes: 'Expected {allButLastType} or {lastType}',
imageValidateSizeLabelFormatError: 'Image type not supported',
imageValidateSizeLabelImageSizeTooSmall: 'Image is too small',
imageValidateSizeLabelImageSizeTooBig: 'Image is too large',
imageValidateSizeLabelExpectedMinSize: 'Minimum size: {minWidth} × {minHeight}',
imageValidateSizeLabelExpectedMaxSize: 'Maximum size: {maxWidth} × {maxHeight}',
imageValidateSizeLabelImageResolutionTooLow: 'Resolution is too low',
imageValidateSizeLabelImageResolutionTooHigh: 'Resolution is too high',
imageValidateSizeLabelExpectedMinResolution: 'Minimum resolution: {minResolution}',
imageValidateSizeLabelExpectedMaxResolution: 'Maximum resolution: {maxResolution}'
});
</script>
Here are the relevant snippet:
[[!FormIt?
&preHooks=`Formit2AjaxUpload`
&hooks=`spam,math,userAgent,FormItSaveForm,AjaxUpload2Formit,AjaxUploadAttachments,email,AjaxUploadRemove,redirect`
&formName=`pmsKontakt`
&formFields=`email,firstname,name,typ,mailAn,row1,row2,row3`
&fieldNames=`row1==REMOTE_ADDR,row2==REMOTE_HOST,row3==HTTP_USER_AGENT`
&ajaxuploadTarget=`uploads/`
&ajaxuploadUid=`attachWeb`
&emailTpl=`pmsEmailChunk`
&emailTo=`[[+mailAn]]`
&emailSubject=`Gesendet vom Kontaktformular [[++site_name]]`
&redirectTo=`19`
&mathMinRange=`1`
&mathMaxRange=`12`
&validate=`math:required,
firstname:required:maxLength=50,
name:required:maxLength=50,
email:email:required:maxLength=60,
text:required:stripTags:maxLength=2000,
typ:required,
mailAn:required,
datenschutz:required,
name2:blank`
]]
[[!AjaxUpload?
&addCss=`1`
&uid=`attachWeb`
&acceptedFileTypes=`image/jpeg,image/gif,image/png,image/webp,application/pdf,text/plain,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document`
&maxFileSize=`8MB`
&maxFiles=`4`
&showCredits=`0`
]]
Thank you
Jo (Bitburg - Germany)