Jako / AjaxUpload

Snippet/jQuery Wrapper for Andrew Valums file upload in MODX Revolution
https://jako.github.io/AjaxUpload/
GNU General Public License v2.0
10 stars 18 forks source link

Unable to upload video file formats #58

Closed CamilleBeaute closed 1 year ago

CamilleBeaute commented 1 year ago

I am currently using AjaxUpload in conjunction with a Formit form. Below is the Formit snippet call:

[[!FormIt?
    &preHooks=`Formit2AjaxUpload`
    &hooks=`spam,AjaxUpload2Formit`
    &ajaxuploadFieldname=`campaign_video`
    &emailTpl=`form-campaign-request-email-tpl`
    &ajaxuploadTarget=`path-to-file`
    &ajaxuploadUid=`campaign_video`
    &ajaxuploadClearQueue=`1`
    &emailSubject=`Email Subject`
    &emailTo=`emailaddress`
    &successMessage=`Success Message`
    &submitVar=`campaign-submit`
]]

Below is the AjaxUpload call within the form:

[[!AjaxUpload?
        &uid=`campaign_video`
        &allowedExtensions=`mp4,mov,avi`
        &thumbX=`75`
        &thumbY=`75`
        &maxFilesizeMb=`50`
        &maxFiles=`1`
]]

Two other forms on my site that contain video upload fields are also no longer working, however they were working several months ago.

CamilleBeaute commented 1 year ago

Hi - just an update. I was able to successfully upload a video which gets saved in the correct folder within the filesystem, however, the form submission success message no longer appears and the notification email is no longer sent.

When submitting the form, the following now gets appended onto the URL:

?updpsuccess=1

Jako commented 1 year ago

The url property ?updpsuccess=1 is created by UpdateProfile. Do you have multiple forms on the page? Then you have to be sure to handle each form separate. FormIt and Login have to use different &submitVar properties. If this is the case, you have to check if both forms use valid html and the form tags are closed for both forms.

CamilleBeaute commented 1 year ago

Hi - No I do not have multiple forms on the page, this is the only one.

Jako commented 1 year ago

Then I don't understand, why ?updpsuccess=1 is appended to the URL. This is not possible with the code of AjaxUpload: https://github.com/Jako/AjaxUpload/search?q=updpsuccess

The spam hook does this neither: https://github.com/Sterc/FormIt/blob/develop/core/components/formit/src/FormIt/Hook/Spam.php

Can you disable the spam hook for a test. Maybe that one is misbehaving.