Posted by chrism2671 on June 11, 2008 at 10:54am
4 followers
Jump to:
| Project: | FileField |
| Version: | 5.x-2.3 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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
#1
Screenshot attached.
For some reason drupal.org isn't showing my attachments, sorry!
#2
#3
Automatic 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 :(
#4
The 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 :)
#5
Quite right - the submit button does upload the file, however as I understand it, just clicking Upload without clicking submit doesn't...
#6
Upload 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?
#7
Yeah actually that's a much simpler solution, I don't know why I didn't think of that!
#8
I would assume nobody hurts me if I close this issue, then.
#9
Automatically closed -- issue fixed for two weeks with no activity.
#10
Apologies 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.