Hi,
I would like to refer to this issue https://drupal.org/node/1804382 and particularly comment #32
I want to remove the "Start upload" button and make the uploading process start automatically as soon as the image files have been selected.
For a while I tinkered with "Plupload integration" module to get this to work, and while it works for others in that thread,it didn't work for me. It turns out that this is because FileField Sources Plupload has it's own plupload.js
Could you PLEASE provide the customisation code for the auto-upload functionality?
Many thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | automatic_upload_for_plupload_files-2101363-14.patch | 1.61 KB | nwom |
Comments
Comment #1
betoaveigaHi Drupalina! I did a script that you can include whenever you need "autoupload" functionality...
Hope that helps!
Comment #2
modstore commentedThanks BetoAveiga,
I just added this code and it works nicely.
Comment #3
nwom commentedI added the js file to my site, but it doesn't seem to autohide the button, or autoupload the files. How did you guys go about implementing the code on the site? Thanks in advanced.
Comment #4
nwom commentedNevermind. Thanks so much for the script. I changed:
var startUploadButtonClass = '.filefield-source-plupload button[type=submit]';
to
var startUploadButtonClass = '.filefield-source-plupload input[type=submit]';
and then it worked.
Comment #5
scotty commentedThanks, #1 with the change from #4 works great. Really improves the UX.
Comment #6
betoaveiga@NWOM sorry I didn't read your comments before :/
@scotty & @modstore I'm glad to help :)
Comment #7
cthshabel commentedThe script that BetoAveiga wrote is nice; however, what about situations where the user wants also "autosubmit" also? Something more like the patch posted here in the same issue queue (Comment #36) Drupalina posted: https://drupal.org/node/1804382
User only wants to upload one single image. So once it is there, the submit button is also triggered to open up image preview.
Comment #8
Steve Bizuns commented#1 combined with #4 worked great. You guys are my heroes today.
Comment #9
Chipie commentedI have tried the script and it works fine, when uploading a file. But when I create a node without a file, the node is not saved. It reloads the form with two plupload widgets:
Anyone having the same issue?
Comment #10
modstore commentedCheck if you have any js errors in your browser console.
Comment #11
Chipie commentedI have solved it by using an event instead of timer:
Comment #12
nwom commentedAny good way we can integrate this into the module as a setting? I can definitely see others benefiting from this feature as well.
Comment #13
nwom commentedIt also appears #11 works with the first files that are either selected or dragged into the upload box. When trying to add additional files, they do not auto-upload. Due to this, I will revert back to the combination of #1 and #4.
Comment #14
nwom commentedAttached is a patch based on the combination of #1 and #4, since #11 had problems with adding files multiple times.
The patch automatically defaults to "auto-upload" for all plupload sources and is fully functional. It however still needs work, in order to make it optional instead. Any help would be greatly appreciated.
Comment #15
vaccinemedia commentedI've applied the patch and unfortunately the files are not auto uploaded. I have checked and the js file added by the patch is being added as is the style tag in the head which is also not hiding the start upload button. Is there not a way we can solve this as per the suggestion here?
https://drupal.stackexchange.com/questions/87033/how-can-i-make-plupload...