We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13428 ☆ A M B ☆
    • 1,031 Posts
    That is just a warning (it is removed in 1.1.1-pl2) and should not stop sending mails.
      • 49246
      • 4 Posts
      Hallo. I am having some issues with Ajax Upload. Any help with solving the following problems will be very much appreciated. I have spent the last few hours trying to figure it out by myself but since it could be something really easy that in my inexperience I am unable to see, I would like to ask you for some help.

      Basically it works fine (it sends the email and copy the image) but whenever I reload the page, upload another image and submit the form again the previously uploaded image in assets/images/user/ gets overwritten (even if the new file has a different name). Plus the fact that all files appear with their original names.

      I am trying to build a site for a person who prints some pics on shirts and etc. and I want the visitor to be able to upload their own images, see a preview and send a order. So the problem with the issue described above is what will happen if the visitor order a particular shirt and then returns back to upload another design for a second order - the first image will be lost.

      Thanks for your help.



      The configuration is pretty much as it is in the Ajax Upload Documentation.
      [[!AjaxUpload?
      &uid=`image`
      &allowedExtensions=`jpg,jpeg,png,gif`
      &maxFiles=`1`
      ]]

      [[!FormIt?
      &preHooks=`Formit2AjaxUpload`
      &hooks=`AjaxUpload2Formit,email,redirect`
      &emailTpl=`MyEmailChunk`
      &submitVar=`submit`
      &ajaxuploadFieldname=`image`
      &ajaxuploadTarget=`images/user/`
      &ajaxuploadUid=`image`
      ]]
        • 50019
        • 1 Posts
        Hello. Sorry for the bad english. I use Google translator))

        Trying to upload jpg-file (size 1 MB), but get the error:

        increase post_max_size and upload_max_filesize to 8M

        Why using php 5.5 error occurs? [ed. note: skarb88 last edited this post 11 years, 7 months ago.]
          • 13428 ☆ A M B ☆
          • 1,031 Posts
          It is the max post size/max upload filesize. AjaxUpload checks if both values are set high enough (they have to be larger than the maxFilesizeMb setting of AjaxUpload). So decrease AjaxUpload maxFilesizeMb parameter or increase post_max_size/upload_max_filesize php setting.
            • 50304
            • 3 Posts
            Hallo, Jako! I have problem with AjaxUpload. When I try to upload files, parameter fileid generated not correctly, it dublicated. If I upload 10 files, AjaxUpload upload 5 or 6 files. Sorry, for my english. Attach screenshot:
              • 13428 ☆ A M B ☆
              • 1,031 Posts
              It seems that a counter is not increased for some reason. I have no idea what is going wrong there. Could you post a link to the installation?
                • 50304
                • 3 Posts
                http://www.cruisegid.ru/users/napisat-otzyiv-o-porte.html?id=669 - this URL where I call ajaxUpload with debug mode. ajaxUpload on the bottom of the page. Sorry for multipost))
                  • 13428 ☆ A M B ☆
                  • 1,031 Posts
                  I see no specific issue on that page.

                  But there could be another problem: Do you have multiple pages/forms with ajaxUpload in your installation? Then each page/form should have a different ajaxuploadUid set in FormIt Call. Otherwise all forms use the same upload queue, which could cause that key problem.

                  The uid is calculated at the moment with 'md5($this->modx->getOption('site_url')' which is not page specific. Will be changed in next version, if it does not cause other issues.
                    • 50655
                    • 2 Posts
                    Quote from: mot9imodx at Apr 18, 2015, 11:44 AM
                    Hallo, Jako! I have problem with AjaxUpload. When I try to upload files, parameter fileid generated not correctly, it dublicated. If I upload 10 files, AjaxUpload upload 5 or 6 files. Sorry, for my english. Attach screenshot:
                    Same problem from time to time.. I connect ajaxuploader with migx and newspublisher in frontend. All works fine except this problem.
                      • 50764
                      • 5 Posts
                      Hi Jako and all! And thanks for your great add-on, Jako!

                      I ran into the following problem. I have a number of frontend-editable resources on my website and I use ajaxUpload to upload images for them. But when I hit "submit" and the form is saved ajaxUpload-ed images are saved to target directory, the ajaxUpload queue IS NOT cleared. So when I go to "edit resource" again, I see all the images I've just uploaded already in the queue ready to get uploaded once again!

                      I do use page-based UID for ajaxUpload so the problem is not about keeping different resources independent. The problem is about the already-uploaded images reappearing in the upload form if I go to Edit once again.

                      I thought it would be natural to get the queue flushed when the images are saved to target. So I added $ajaxUpload->clearValue() to AjaxUpload2Formit snippet, like this:
                          default :
                              $ajaxUpload->saveUploads($ajaxuploadTarget);
                              $ajaxUpload->deleteExisting($ajaxuploadTarget);
                              $ajaxuploadValue = $ajaxUpload->getValue($ajaxuploadFieldformat);
                              $hook->setValue($ajaxuploadFieldname, $ajaxuploadValue);
                              $ajaxUpload->clearValue();
                              $success = true;
                      

                      The question: Is this correct enough or is it better to do it in a different way? And am I right that the queue should get flushed when images are saved to target? What do you think? Looking for an advice.