We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52629
    • 2 Posts
    Quote from: Jako at Aug 15, 2016, 08:05 AM
    Quote from: priya1711 at Aug 12, 2016, 06:18 AM

    When I upload the file it shows me in /assets/components/ajaxupload/cache but my image files are not getting saved in desired directory when I hit the save button.

    Does the folder /assets/images/uploads/ exist and is it writable for PHP?
    Yes the folder exist and the permission 0755 is given to that folder
    • Please try version 1.5.2, there was an issue in 1.5.+ that cleared the upload queue too fast in some circumstances.
        • 8168
        • 1,118 Posts
        Hi, Can AjaxUploader work when its called more than once in a formit form? e.g. I have 5 different file upload inputs that I need to use it on within 1 form... can't seem to work out how to get it to work when calling the

        [[!AjaxUpload?
        &uid=`image`
        &allowedExtensions=`jpg,jpeg,png,gif`
        &thumbX=`75`
        &thumbY=`75`
        ]]
        


        More than once?
        • The script supports multiple upload queues, but the hook not (at the moment).
            • 42652
            • 7 Posts
            Hi there, I use php 7.0.10 on MODX Revolution 2.5.1-pl (traditional),
            I have a prob with additional attachments to AjaxUpload. Uploading Images works fine. Uploading other stuff, a .pdf for example and I am getting an error.
            Is it possible that it's the php-Version? I cannot switch the versions.



            Here is my code, first the FormIt Call:
            <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
            <script>window.jQuery || document.write('<script src="ProLicht/Script/jquery-1.12.4.min.js"><\/script>')</script>
            [[!FormIt?
                &preHooks=`Formit2AjaxUpload`
                &hooks=`AjaxUpload2Formit,AjaxUploadAttachments,math,spam,redirect,FormItAutoResponder,email`
                &ajaxuploadFieldname=`image`
                &ajaxuploadTarget=`../formularinhalte/`
                &ajaxuploadUid=`image`
            
                &emailHtml=`0`
                &emailTpl=`MyEmailChunkNoHTML`
                &emailTo=`[email protected]`
                &emailSubject=`Daten aus dem Bewerbungsformular von [[++site_url]]`
                &validate=`nospam:blank,
                  application:required:stripTags:minLength=^3^:maxLength=^75^,
                  name:required:minLength=^3^:maxLength=^75^,
                  phone:required:minLength=^3^:maxLength=^25^,
                  email:email:required,
                  text:required:stripTags:minLength=^3^:maxLength=^3000^
                  math:required`
                &vTextRequired=`benötigt`
                &vTextEmailInvalid=`Die E-Mail Adresse ist nicht korrekt.`
                &vTextMinLength=`Zu wenig Zeichen.`
                &vTextMaxLength=`Zu viele Zeichen.`
                &validationErrorMessage=`Das Formular enthält Fehler und wird nicht versendet.`
                &redirectTo=`258`
                &store=`1`
                &fiarReplyTo=`[email protected]` 
                &fiarTpl=`autoResponseTpl`
                &fiarToField=`email`
                &fiarFromName=`URL Name`
                &fiarFrom=`[email protected]` 
                &fiarSubject=`Vielen Dank für Ihre Bewerbung`
                &fiarHtml=`1`
            ]]


            ../formularinhalte/ exists and has writing permissions.

            Now the AjaxUpload-Call.
            [[!AjaxUpload?
                        &uid=`image`
                        &allowedExtensions=`jpg,jpeg,png,gif,tif,pdf,doc,docx,xls,xlsx,ppt,pptx,pps,ppsx,txt,rtf,zip,7zip`
                        &thumbX=`100`
                        &thumbY=`100`
                        &maxFiles=`6`
                        &maxFilesizeMb=`6`
                    ]]


            In the error-Log there is:
            [2016-09-12 19:23:13] (ERROR @ /pages/core/model/modx/modconnectorresponse.class.php : 151) PHP warning: Cannot modify header information - headers already sent by (output started at /pages/core/model/phpthumb/phpthumb.filters.php:12)

            Looks like the thumbnail cannot be created.
            Something similar to this https://forums.modx.com/thread/100091/no-thumbnails-in-media-browser-with-php-7-0-4 perhaps

            After reloading the page the false document will be uploaded.

            I even changed line 149 in
            /pages/core/components/ajaxupload/model/ajaxupload/ajaxupload.class.php

            $allowedExtensions = $this->modx->getOption('allowedExtensions', $properties, 'jpg,jpeg,png,gif');


            But that did not change anything. Any clue anyone?
            • This is more a modPhpThumb issue than an AjaxUpload issue.

              Maybe it could be solved with that PR: https://github.com/modxcms/revolution/pull/13125

              Please download my 2.5.x fork on https://github.com/Jako/revolution/archive/2.5.x.zip and replace the core/model/phpthumb folder on your host with the downloaded core/model/phpthumb folder. Backup that folder first.

              [ed. note: Jako last edited this post 7 years, 7 months ago.]
                • 36582
                • 463 Posts
                I've had to uninstall due to time constraints but if it's any help, I ran into a similar problem to that of AndyWizz. Tried it with both .jpg and .pdf. Running PHP 5.6 and Modx 2.5. I also replaced the phpthumb folder. I couldn't get anything to upload.

                [2016-09-15 14:28:28] (ERROR @ /var/www/vhosts/mysite.com/httpdocs/core/model/modx/modconnectorresponse.class.php : 145) PHP warning: Cannot modify header information - headers already sent
                [2016-09-15 14:28:28] (ERROR @ /var/www/vhosts/mysite.com/httpdocs/core/model/modx/modconnectorresponse.class.php : 150) PHP warning: Cannot modify header information - headers already sent
                [2016-09-15 14:28:28] (ERROR @ /var/www/vhosts/mysite.com/httpdocs/core/model/modx/modconnectorresponse.class.php : 151) PHP warning: Cannot modify header information - headers already sent

                  Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
                • AndyWizz got the wrong branch in the first download. The download with the patched phpThumb in MODX is in the corrected link above. It will go into 2.5.2.
                    • 36582
                    • 463 Posts
                    Thanks for getting back to me Jako.

                    I downloaded from the link just today - is that correct?
                      Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
                    • AndyWizz had a PHP7 issue. Your issue is different.

                      Is there any message returned in the connector.php call of AjaxUpload? The 'PHP warning: Cannot modify header information - headers already sent' does not help further here. Do you have an URL where I could see this? You could send me a PM, if you don't want to post this here.