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'?

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!


chrism2671’s picture

Title: Automatic Upload » screenshot attached

Screenshot attached.

For some reason isn't showing my attachments, sorry!

chrism2671’s picture

Title: screenshot attached » Automatic Upload
jpetso’s picture

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 :(

dopry’s picture

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 :)

chrism2671’s picture

Quite right - the submit button does upload the file, however as I understand it, just clicking Upload without clicking submit doesn't...

jpetso’s picture

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?

chrism2671’s picture

Yeah actually that's a much simpler solution, I don't know why I didn't think of that!

jpetso’s picture

Category: feature » support
Status: Active » Fixed

I would assume nobody hurts me if I close this issue, then.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

cwithout’s picture

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.