We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Added cache_expires System Setting in AjaxUpload 1.4.0
      • 11121
      • 79 Posts
      Quote from: Jako at Feb 09, 2016, 11:49 AM
      In this line

      Should be done better in a MODX system setting.

      Thank you!
        • 11121
        • 79 Posts
        After updating to new version, AjaxUpload is creating image path like this (not working):

        /var/www/vhosts/xxxxxx.xx/httpdocs/assets/components/ajaxupload/cache/article-2079237-0F4A1D3100000578-75_964x662.jpg


        instead of this (working):
        /assets/components/phpthumbof/cache/philbib_930_zpscmotzfar.fea5bb792d4dc2f558f49e0d185dc859106.jpg [ed. note: gordonas last edited this post 8 years, 2 months ago.]
        • The ajaxupload.cache_expires system setting was never used, because a cache_expires system setting exists. Also a removing not existing images from the queue bug occured. Fixed in 1.4.1
            • 11121
            • 79 Posts
            Quote from: Jako at Feb 10, 2016, 09:48 AM
            The ajaxupload.cache_expires system setting was never used, because a cache_expires system setting exists. Also a removing not existing images from the queue bug occured. Fixed in 1.4.1



            ajaxupload.cache_expires at settings, is for changing the code below at components > ajaxupload > model > ajaxupload > ajaxupload.class.php ?

            public function clearCache($hours = 4)

            I am asking because I change setting and public function clearCache remains the same.
            • clearCache method is called in AjaxUpload class using that setting.
                • 11121
                • 79 Posts
                Quote from: Jako at Feb 11, 2016, 07:36 AM
                clearCache method is called in AjaxUpload class using that setting.


                When I change clearCache indeed file does not delete from Ajaxoplad cache folder. But queue is still getting flashed. When I try to edit Form after 4 hours, thumbnail is not there anymore. Even if I change public function clearCache($hours = 4), 4 hours remains the limit. [ed. note: gordonas last edited this post 8 years, 2 months ago.]
                • Could it be the MODX session, that is flashed then? If yes, we can't fix anything with this behaviour.

                  You have to fill the upload queue by Formit2AjaxUpload with a hook running before. The hook running before has to fill the ajaxuploadFieldname field and copy the corresponding file(s) to ajaxuploadTarget.
                    • 11121
                    • 79 Posts
                    MODX session has to do with &ajaxuploadUid and &uid ?

                    I thought that if I set a unique id for ajaxuploadUid and uid, that was all I need to create a specific queue for each resource. [ed. note: gordonas last edited this post 8 years, 2 months ago.]
                    • Yes, the upload queue is stored in the MODX session. The queue is there for handling the uploaded files until the form is posted.

                      After a form post, the files are moved to the ajaxuploadTarget with the AjaxUpload2Formit hook.

                      If the ajaxuploadFieldname field is filled with a comma separated list of filenames and those files exist in ajaxuploadTarget, the upload queue is filled with Formit2AjaxUpload hook when the form page is shown.