Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Could I request an option that allows the file to be uploaded automatically as soon as somebody selects a file, rather than having to go through the second step of clicking 'Upload'?
Background:
On my site the user has an filefield on their profile for a CV. There is nothing else on the page, so it's not obvious that after the user clicks 'Upload' he/she must then click submit. Equally, if the user clicks 'Submit' instead of Upload, the changes are lost.
I would propose this be a simple atttribute option of the filefield.
Great work by the way!
Comments
Comment #1
chrism2671 CreditAttribution: chrism2671 commentedScreenshot attached.
For some reason drupal.org isn't showing my attachments, sorry!
Comment #2
chrism2671 CreditAttribution: chrism2671 commentedComment #3
jpetso CreditAttribution: jpetso commentedAutomatic activation of the "Upload" button is not possible as the file selection line is browser specific and doesn't emit an event that we could reliably catch (afaik). However, pressing "Submit" without "Upload" should work... I have never encountered or even heard of a case where skipping the "Upload" button fails. (Actually, it works a lot more reliable than with AJAX and all that jazz.)
In short, I have no idea how I could help you with this problem :(
Comment #4
dopry CreditAttribution: dopry commentedThe onchange handler is fairly reliable. You can extend it with JS... Look the onchange handler in filefield.js that provides the client side validation.. at least it does for me :)
Comment #5
chrism2671 CreditAttribution: chrism2671 commentedQuite right - the submit button does upload the file, however as I understand it, just clicking Upload without clicking submit doesn't...
Comment #6
jpetso CreditAttribution: jpetso commentedUpload does indeed upload the file, it just doesn't save it in the node yet (as is consistent with existing node semantics - nothing is saved unless you click "Submit"). So the solution for one-stop uploading would be to theme away the "Upload" button and you're done, right?
Comment #7
chrism2671 CreditAttribution: chrism2671 commentedYeah actually that's a much simpler solution, I don't know why I didn't think of that!
Comment #8
jpetso CreditAttribution: jpetso commentedI would assume nobody hurts me if I close this issue, then.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
cwithout CreditAttribution: cwithout commentedApologies for commenting on a very old, dead issue, but I want to make this easier to find for people currently looking for this solution. If you came across this issue in a search of auto upload in Drupal 6 or 7 (for either core or media files), please see the AutoUpload module.