I think ImageField has a somewhat strange interface for uploading multiple images to a node.
In order to add another image after having uploaded one, you have to click the "Add another item" button to get a blank upload field. You can even click the button and have several new upload fields, even though this has no practical use, since you can only upload one image at a time anyway.
I think this UI is counter-intuitive. The "Add another item" button with its ambiguous caption leaves many users confused as to what sort of "item" will be added. Also, user's expect the system to just present them with the required fields automatically.
Why not make only one blank field available at all times and remove the "Add another item" button completely. There should only be one blank upload field available at a time, and when an image is uploaded, a new blank upload field should appear.
These thoughts are based on my own first time experience with the UI, and my testing on a few other people. Hope you will consider making this change.
Comments
Comment #1
quicksketchUnfortunately ImageField does not control the "Add another item" button or the handling of multiple files at all. This is all handed by CCK and keeps ImageField inline with the way all other CCK fields work (like a textfield). It's also necessary to maintain this approach so that ImageField will be compatible with the ability to group fields together (#119102: Combo field - group different fields into one) when that becomes available.
However this doesn't mean the workflow can't be improved, it just means that we'll need to be clever with the kind of solutions we use. We probably shouldn't remove the "Add another item" button, since it's not controlled by ImageField, but we could make ImageField automatically provide another (empty) field for you when a file is uploaded (I think).
Just a note also:
This does have some practical use in that you can potentially upload multiple files at once (click "Add another item" 5 times, select 5 files, click "Upload" on each one of them). This has become even more useful now that FileField supports progress bars (see #318960: Upload Progress Bar (rfc1867 support)).
Comment #2
rsm08 commentedI see what you mean. Personally I think the option for the user to add his own fields sounds a little far out and something that would only be usable by expert users, though, so they might want to make such a thing an optional add-on instead of a standard setting. Unfortunately for me, I don't have the privilege of designing sites for hardcore programmers or the like. Instead I make sites for really stu..... really ordinary people, so simplicity and intuitiveness are key factors. :)
I thought you might be able to do that, and maybe 5 of my 50,000 users will figure out that they could save a little upload time this way, but it's just not intuitive. If multiple file upload is possible, users should be able to select multiple files in the browse dialogue. That is what they will expect.
That would be a good solution, and if a new upload field doesn't appear automatically (which it does do sometimes?!) I fear many user's won't find out that more than one file can be uploaded.
BTW is multiple file upload in one upload field possible with PHP, or do you need some flash or java app for it?
Comment #3
quicksketchNo it's not possible with HTML/JavaScript. It requires Flash to enable multiple file uploading. The Image FUpload project builds on ImageField and makes this possible, though it's workflow is specifically geared towards bulk image uploading and doesn't seem too practical for single file uploads.
Comment #4
rsm08 commentedWow. That's a cool module - exactly what I was looking for! Thanks for the tip!
Comment #5
quicksketchI tried to make an extra field appear after uploading, but the task doesn't seem possible the way FileField is currently written. When the upload button is clicked, FileField only has control over a single row in the multivalue list. Without rewriting the AHAH callback to affect the entire table, we can't provide this functionality.
The most reasonable way to fix this would be to create an entirely new widget (perhaps "FileField Multiple") to handle this case. I think its best to keep the original FileField the way it is, considering we're in release candidates and this effort would seriously change the way FileField works. Of course, you could just use another module made for multiple uploading like Image FUpload and then we don't need to do anything.
Moving to postponed for the time being.
Comment #6
mudd commentedWould it be possible to have it so the Save button doesn't cause any uploads? Perhaps also popup an alert: "Warning: you haven't uploaded all your files".
I've temporarily hidden "Add another item" because due to my app accepting gigantic files, I need user feedback as the uploads happen. I can't have users populate 5, 10, or 20 fields with 1GB files (my site allows unlimited uploads) and click Save, and then have the site sit there for hours -- I need to have positive feedback on each upload. (because the progress bar works only when individual upload buttons are pushed -- and I love the progress bar!)
For me, this idea is alternate to 1) have Save kick off each of the uploads and show progress bars, and/or 2) automatically add another upload only after the user uploads the existing input(s).
I realize that giant files weren't the idea when you created this module, but I''m now committed to FF and I'd like to help any way I can, even if that trying to conceive of designs that work for both casual small files and strenuous mega uploading. I guess I could add either of these in my help-text -- when showing Add another item: A) "Please upload each of your files using the provided Upload buttons! Not doing so will still upload files but without progress bars, so you'll have no progress status or indication of failures if they occur" or -- when only showing one upload at a time, no Add-another-item B) "Please save your project after uploading to generate another upload field".
Also, how do you feel about immediately hiding fields left over after a file is removed? (because of the inconsistencies with having one or many fields). Perhaps a check box switch?
Comment #7
jpl-2 commentedThe really sad part is that automatic providing of additional fields for multiple files already worked as it ought to in Drupal 5.x. And now it seems that there is no easy fix on the horizon. One of those nasty migration surprises. Administering a workflow-oriented site geared toward non-technical users who have to upload many files, I am going to have some heavy explaining to do about why this basic functionality got "broken". More likely I will hack the hell out of filefield/cck whatever to make it work as before... so much for modular design and reusability :-(
Comment #8
quicksketchjpl: You may be slightly consoled by the fact that FileField in Drupal 7 (just called File now, part of core), acts exactly the way Upload module used to (Upload module has been removed from core). As I suggested in #5, the only way to do this was to essentially write an entirely new widget that handles multiple values manually instead of letting CCK handle it. It's still possible to add such a widget without hacking CCK/FileField, take a look at modules that build on FileField like Image FUpload.
Comment #9
jpl-2 commentedThanks for the suggestion. For the time being, I decided to make it a bit more bearable for the users by theming the add button ("Add another file" instead of "Add another item") and also putting it in the last row of the "multi-value table" created by CCK rather than below it. Furthermore, I themed away the useless/confusing drag-and-drop reorder icon and the position widget. The users' reaction to this "improvement" remains to be seen. :-)
Comment #10
Andrew Gorokhovets commentedsubscribe
Comment #11
3dloco commented=1
See related
#841914: Provide options to set how many fields are initially displayed and how many are added on click of "add more" cck3
#530828: Provide "Add more values" button for fields (and multigroups) with fixed number of multiple values cck2
Comment #12
1kenthomas commentedSubscribing: //Why not just keep track of reloads, and activate the button on each one after submission?
Comment #13
quicksketchThis is finally getting fixed in Drupal *8* in #625958: Support Uploading Multiple Files for HTML5 Browsers via #multiple attribute. For users of D6 and D7, I recommend they take a look at Plupload module (which provides an entirely new widget for handling multiple files, like I mentioned would be possible in #8).