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

Some customization #3

Closed argnist closed 8 years ago

argnist commented 9 years ago

Nice extra but I haven't found the way to customize js part of it. I changed some js to load image path to hidden input to save it as TV through Tickets.

Jako commented 9 years ago

I hope I understood your question right: You could extend the wrapper script to do something else after successful upload in https://github.com/Jako/AjaxUpload/blob/master/source/js/web/ajaxupload.js#L79-L104. There are similar 'if success' branches in remove and clear method.

But the real filename of the uploaded file is stored in the session and can't be used in javascript to avoid hotlinking. This filename is available i.e. in FormIt Hook after the form submission.

The files are now uglified in assets/components/ajaxupload folder and have to be built with the Gruntfile.js