Progress bar - patch for mediafields
esadot - March 29, 2007 - 18:27
| Project: | Media Field |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Would be great if the mediafield module would provide a displayed progress bar. Even better if such capability would be part of the core, or at least as a dedicated module.
Browsing through drupal.org yield several discussions on the subject.
To be more pragmatic: could the progress bar solution incorporated in the video module (http://drupal.org/node/69800) be imported? or be affiliated? or detached to a dedicated feature / module?

#1
For informations, the Imagefield project just implemented an Ajax upload feature with a progress bar... i guess it might be possible to join forces on this (the code is not too complicated)
(since filefield, imagefield, mediafield already share some common code...)
#2
Thank you for the information.
We will work on this feature asap.
#3
I didn't find AJAX upload in a new imagefield.module.
Are you sure?
#4
Yes Ajax upload support has been added to the DRUPAL-4-7--2 and DRUPAL-5--2 branches (not sure it has been comited as stable yet).
You might have to grab the cvs version to get the updated code.
Newbie question : think it could be usefull to merge/pack Imagefield and Mediafield (ala e-commerce), to work on common include files (file operation, id3, ajax support while keeping CCK definition apart) ?
#5
Ok, I'll try it.
Packing all CCK file fileds together is a good idea and it is already discussed with imagefield author (Dopry). I'm now waiting for an answer from him about the better approach to do that. At the moment he thinks that he will put our common file into fileupload.module and make all other such media modules depend on it.
#6
I might be missing something.
I checked out drupal 5.2, cck and imagefield 5.2, created new type which contain cck image, but when i upload an image the progress bar doesn't present itself.
#7
I also didn't find it.
#8
#9
The progress bar is included in the 2.x-dev version of the imagefield.module.
I've tried playing with the code to get it to work correctly, in the mediafield.module but alas, I could not.
I think this would ease quite a bit of the frustration with users who get impatient waiting for the browser progress bar to complete.
the image module calls the progress bar around line #573
function _imagefield_widget_form($node, $field, &$items) {drupal_add_js('misc/progress.js');
drupal_add_js('misc/upload.js');
There must be more to it then what is above, because I added those lines to the audiofield.module and the progress bar did not appear.
I'm going to mark this issue as active, so that I can work on it some more and hopefully others will jump in.
ARDAS, if changing the status is the wrong this to do for this, I apologize in advance
#10
Patch to add progress bar to videofield and audiofield modules.
Note the progress bar does not really show actual progress but only displays a dynamic gif.
If you want to see actual progress i.e. %uploaded - I have code that can help.
PHP had limitations until PHP5.2 where it is unable to provide upload reliable information (%uploaded etc) for PHP applications.
PHP 5.2 and above supports the functionality however you must do 2 things:
a) install an extension such as APC (doesnot work in CGI or fastCGI) or uploadprogress (buggy but works with CGI and fastCGI) - this is not yet supported by my module.
b) add support to drupal's upload.js and some custom code to actually fetch the progress. see http://www.hyrme.com/node/18 if you are feeling adventurous.
#11
Thanks panis.
Can you publish a module that offers actual progress bar to the benefit of Drupal community (with the limitation of php5.2)
Regards,
#12
I already have one on my site - I do not want to upload it onto drupal.org without a more testing..
Also so that I do not duplicate code - my approach will need a patch to misc/upload.js to make use of existing hooks in drupal - do you think that is acceptable?
#13
The patch in #10 works wonderfully. I think this is a great addition. My opinion is this is RTBC
#14
panis - my suggestion would be to craft it as a (alpha or beta) module, and let the drupal community plays with it. Introducing as a module will (imho) draw the exposure one would hope for.
Many drupal modules would benefit from a real progress bar (from ec via media/video to webfm), and if patches to other files (i.e. misc/upload.js) are required at this stage - let it be.
My 2 cents
#15
#16
I will review the patch soon. Thanks a lot for your patience and work.
#17
Subscribing.
#18
great module...is there a way to upload many images without page reload, because when I press on upload it uploads and refreshes the page...gives error if the user has not yet entered subject etc.
#19
I echo VeryMisunderstood's comment, the #10 patch worked great, RTBC.
#20
Thanks - this really came in handy!
#21
Subscribe -
I am waiting for a new version of module with ajax uploading!
#22
Is there any way to implement that patch to AUDIO module? That patch work for AUDIOFIELD, but i need that in audio module.
#23
@Shinzon : I doubt it, different modules means different code, so a code patch is very unlikely to work. You might open a issue in the AUDIO module's queue asking for the feature, and/or start a bounty to get it done.
#24
This patch is now in HEAD (http://drupal.org/cvs?commit=123607) and will be included in the next release.
#25
Automatically closed -- issue fixed for two weeks with no activity.