This module uses client-side JavaScript to display the progress of a running upload with Drupal's own Drupal.progressBar.
It does not require the uploadprogress PECL module or APC and works great on configurations without Apache/mod_php, i.e. FastCGI/fcgi on Apache or Nginx or Lighttpd.
It has long been a problem that the upload progress bar works, by default, only with Apache and mod_php.
This is why nginx users have created filefield_nginx_progress to solve the problem under certain nginx configurations. However, until now there is no solution for providing the upload progress bar with users of Apache with FastCGI or of other server configurations. This problem has been known since at least 2009 and this project aims to fix that.
The JavaScript for this is supported by all major browsers.
Clone the project here:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/wmnnd/2402133.git upload_progress
Project link:
https://www.drupal.org/sandbox/wmnnd/2402133
Comment | File | Size | Author |
---|---|---|---|
#42 | bootstrap-fix-2402147.patch | 603 bytes | pmusaraj |
Comments
Comment #1
wmnnd CreditAttribution: wmnnd commentedComment #2
wmnnd CreditAttribution: wmnnd commentedComment #3
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxwmnnd2402133git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #4
mihai_brb CreditAttribution: mihai_brb commentedHi wmnnd,
Please fix the README file, lines should not exceed 80 characters. Also please use this template:
https://www.drupal.org/node/2181737
Instead of adding the jQuery form file from your module module why don't you rely on jquery_update and require a specific version.
There is an old module named upload_progress. I think you need another name for the module.
On a node/add form that has a file upload field I get the following error triggered from your js file. So I was unable to test how the module works.
I've updated the git clone command.
Comment #5
wmnnd CreditAttribution: wmnnd commentedHello mihai_brb,
thank you for looking into this.
I have updated the README file to go with the template you linked and fixed the problem that you described.
The reason I am including jquery.form is that jquery_update does not provide an appropriate version of jquery.form because it's not part of the actual jQuery library.
Comment #6
wmnnd CreditAttribution: wmnnd commentedComment #7
mihai_brb CreditAttribution: mihai_brb commentedwmnnd,
jQuery Update module will add the jquery.form.min.js?v=2.69. Isn't that sufficient?
Other than that, the jQuery Form Plugin you add requires jQuery v1.5 or later, so you don't you need the jquery update module anyway?
There's an issue regarding updating the jquery.form lib trough jQuery Update module here https://www.drupal.org/node/2266303
Also, as per https://www.drupal.org/node/1587704 4. Licensing checks
Comment #8
mihai_brb CreditAttribution: mihai_brb commentedComment #9
wmnnd CreditAttribution: wmnnd commentedHello mihai_brb,
thank you for your suggestions again.
Unfortunately, jquery.form 2.69 is not sufficient because it does not expose the XMLHttpRequest.upload object and there is no other way of obtaining it.
And while the plugin states that it requires jQuery 1.5, there are no issues while using it with Drupal 7's default jQuery 1.4.4. The changes that would require jQuery 1.5 are not used by Drupal and/or this module. In the jquery.form issue in jquery_update, there are also no reports that updating jquery.form would break any functionality. In fact, the issue you refer to mentions that updating jquery.form solved incompatibility issues.
Concerning the Libraries API, jquery.form is licenses under the GPLv2 so I would prefer not using Libraries as it would make the installation unnecessarily complicated. Just like jquery_update, I think this module should be able to ship the required code in its repository.
Comment #10
yuriy.kostin CreditAttribution: yuriy.kostin commentedHi Wmnnd,
You have some error on automated review:
Please use hook_libraries_info() to fix this.
Comment #11
yuriy.kostin CreditAttribution: yuriy.kostin commentedComment #12
glynster CreditAttribution: glynster commentedAny further progress here? This would be an extremely useful module for the community as FCGI/Apache is very common.
Comment #13
wmnnd CreditAttribution: wmnnd commentedglynster: You can actually use the module already, it should work without problems. I'd be more than happy to hear your feedback :-)
Maybe a reviewer could look at this again? I don’t agree with yuriy.kostin’s view that this module needs work simply because of the warning from the automated review. As I have explained in comment #9, I would not like to use the libraries module and thus including the minified JS file for the jquery.form library, seems to be the best solution to me.
Comment #14
wmnnd CreditAttribution: wmnnd commentedComment #15
glynster CreditAttribution: glynster commented@wmnnd when using this on a couple of themes the JS breaks using version jquery 1.10. That is my issue.
Comment #16
wmnnd CreditAttribution: wmnnd commented@glynster: Could you be a bit more specific about what exactly is breaking for you?
Does it work with Seven as your admin theme?
Comment #17
prajaankit CreditAttribution: prajaankit commentedHi wmnnd,
we run the PHP_CodeSniffer for your code here is one error
FILE: /var/www/drupal-7-pareview/pareview_temp/js/jquery.form.min.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
----------------------------------------------------------------------
I suggest you follow these links to remove this error
As follows
https://github.com/squizlabs/PHP_CodeSniffer/issues/252
https://code.google.com/p/minify/wiki/CommonProblems
https://www.drupal.org/node/1556034
these links helps to remove this error
wmnnd, keep it up :)
Comment #18
prajaankit CreditAttribution: prajaankit commentedHi wmnnd,
we run the PHP_CodeSniffer for your code here is one error
FILE: /var/www/drupal-7-pareview/pareview_temp/js/jquery.form.min.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
----------------------------------------------------------------------
I suggest you follow these links to remove this error
As follows
https://github.com/squizlabs/PHP_CodeSniffer/issues/252
https://code.google.com/p/minify/wiki/CommonProblems
https://www.drupal.org/node/1556034
these links helps to remove this error
wmnnd, keep it up :)
Comment #19
klausi@prajaankit: removing review bonus, you should only add this to your own application. Please read https://www.drupal.org/node/1975228 again.
@wmnnd:
The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.
Comment #20
wmnnd CreditAttribution: wmnnd commentedThis is starting to feel a little bit Kafkaesque. As I have pointed out before, jquery.form is indeed licensed under the GPLv2 (as stated here) which means there is no license conflict and anyone is free to use its code in any other GPLv2-licensed project such as this one.
The reason I would like to include the JavaScript directly has also been stated before:
I would also like to clarify why I think this module should not use Libraries: Just like for jquery_update, using a newer version of an outdated library shipped by Drupal is actually one of its main functions. This is why it seems to me like it would make little sense to complicate its installation by forcing the user to download jquery.form independently - especially if there is no conflict of licenses.
Again, I would also like to point out that minified JS files produce simply a warning in the automated review process and not an »error«, so while some might consider it better not to use minified JS code, this is not a requirement.
Comment #21
wmnnd CreditAttribution: wmnnd commentedComment #22
klausiThe problem is not licensing, our policy for contributed projects is simply:
Comment #23
wmnnd CreditAttribution: wmnnd commented@klausi: What about jquery_update, then? This module is very similar in how it uses a "3rd-party" library.
Speaking of the policy, the LWG is currently engaged in discussing these very guidelines:
I have created this project to enable other users to use my solution to the problem of showing download progress on fcgi setups which has not been solved otherwise so far. I think it would be a shame if I should be the only one to use this module which greatly improves usability and user experience for uploading files and images in Drupal 7.
Comment #24
klausiJust because some existing modules violate that policy does not mean that the policy is void.
Yes, there is discussion in the LWG currently. Meanwhile the existing policy stands and is an application blocker.
Comment #25
wmnnd CreditAttribution: wmnnd commentedAlrighty then, I have changed the module so that it now requires the user to install jquery.form separately into the libraries folder.
Comment #26
Vikas.Kumar CreditAttribution: Vikas.Kumar commentedManual Review
Comment #27
wmnnd CreditAttribution: wmnnd commented@vks7056: What makes you think this module causes module duplication and/or fragmentation?
Comment #28
Vikas.Kumar CreditAttribution: Vikas.Kumar commented@wmnnd: Could it be a part of FileField Nginx Progress module. As you already mentioned the detail about filefield_nginx_progress module.
Comment #29
wmnnd CreditAttribution: wmnnd commented@vks7056: I don‘t think those modules are particularly similar; they use very different approaches. Most of all, my solution is not limited to nginx and uses client-side JavaScript to avoid additional server configuration unlike filefield_nginx_progress so I think merging with filefield_nginx_progress would be neither possible nor desirable.
Comment #30
wmnnd CreditAttribution: wmnnd commentedDoes no one feel like reviewing this? I really think this little module could be really useful for users of configurations without mod_php.
Comment #31
glynster CreditAttribution: glynster commentedI think this module is very valid, I need to test it again as it was breaking my JS using BS.
Comment #32
joel.gilchrist CreditAttribution: joel.gilchrist commentedHi, if the scenario you are trying to solve is .../file/add then using file_entity, multiform and plupload provides a nice multiple file upload widget with a progress bar, drag and drop capability, does not require the PECL uploadprogress library or APC and it also works with fastcgi/apache. So, this might be considered duplication.
The file_entity module does not cover the case of adding an image to content though, that still appears as the standard progress bar which doesn't work in my environment.
I wanted to install and test but I'm having trouble getting it to work. I have the libraries and upload_progress modules enabled. I have the sites/all/libraries/jquery_form folder with files, but still just getting my plain old (non-working) progress bar. The js files are retrieved by the browser. Is there anything else I can check?
Comment #33
wmnnd CreditAttribution: wmnnd commented@glynster: Let me know if everything is working now!
@joel.gilchrist: Did you make sure to change to field settings to progress bar instead of throbber? Do you maybe have conflicting modules (problems with JQuery update could be theoretically possible) installed?
Comment #34
mdryanAutomated Review
Passes all tests.
Manual Review
It took me a while to realise that without either the uploadprogress PECL module or APC installed there's no option on the file field widget to display a progress bar instead of a throbber. At a minimum the documentation should be changed to note this, although I think ideally the file field widget settings form should be altered to allow access to this setting even where file_progress_implementation() returns false.
Generally though, I think this is a fairly well written module that does one thing and does it well. Subject to this change plus adding a note about alternative modules and strategies for achieving a progress bar (see below) I'd be happy to see this as a full module. I have at least one site where I could make use of this module myself.
core = 7.x should be removed from the .info file; this is added by the drupal packaging system.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
This review uses the Project Application Review Template.
Comment #35
klausicorrection: "core = 7.x" must stay in the info file so that the module works correctly when cloned with git.
Looks like you found no other application blockers, so should this be set to RTBC instead?
Comment #36
mdryanApologies, just discovered the same issue with leaving "core = 7.x" in the info file for my own project. This is confusing in the docs elsewhere (I'll try and fix / file a separate issue there, assuming I can re-find it.)
Anyway, agree nothing else is an application blocker per se, happy to set to RTBC.
Comment #37
glynster CreditAttribution: glynster commentedInstalled again and works super well. Let's get a stable release, very much needed and super handy!!
Comment #38
glynster CreditAttribution: glynster commentedThe only drama on my end is getting this to work with a theme like Bootstrap. Right now you just get an empty bar. This is on the latest version of Bootstrap and Drupal.
Comment #39
glynster CreditAttribution: glynster commentedAny thoughts as to what could be done to make this Bootstrap compatible?
Comment #40
wmnnd CreditAttribution: wmnnd commented@mdryan: Thank you so much for your review!
I would love to promote this as a full project now and extend the documentation as well, but I still cannot publish the project as described here: https://www.drupal.org/node/1068952
Am I missing something?
Comment #41
mdryan@wmnnd. Although I set this to RTBC you still need a git administrator to grant you the Create Full Projects role before you can publish it. The git administrator is supposed to have a final quick scan through your code first. I did think it was supposed to happen automatically though after a few weeks at RTBC, but it seems not.
The best way to persuade a git administrator to look at your code is to review at least three other projects and list them in the issue summary after which you'll be entitled to add the 'PAReview: review bonus' tag. This is a good thing to do for its own sake, but I do also think though (given that this has been sat at RTBC for 4 months) it would be perfectly reasonable to raise the issue priority, or perhaps even to hit up a git administrator on IRC.
Comment #42
pmusaraj CreditAttribution: pmusaraj commentedI found a pretty simple fix to make this work with bootstrap. Just replace this line in upload_progress.js :
with
Basically, this is broken on Bootstrap because Bootstrap uses a button element, as opposed to an input. The modification above makes this work with any submit element (button or input).
Including a patch for the developers.
Comment #43
glynster CreditAttribution: glynster commentedPatch does not work for me, same issue occurs, plus it causes an undefined error with the insert module. Trying to get more concrete info.
Comment #44
mlncn CreditAttribution: mlncn at Agaric commentedAs the module with the same namespace is 8 years old and seeking new maintainers, i've added you to the maintainers of https://www.drupal.org/project/upload_progress so you can move your code there, or you can change your module's name.
Thanks for your contribution! Congratulations, you are now a vetted Git user. You can promote this to a full project.
When you create new projects (typically as a sandbox to start) you can then promote them to a full project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Comment #46
rimu CreditAttribution: rimu commentedIf you want this to work on managed_file form elements then open upload_progress/js/upload_progress.js and change the CSS classes it targets to be something like this
jQuery("input[type=submit]", ".file-widget, .image-widget, .form-type-managed-file").each(function(el) {
instead of
jQuery("input[type=submit]", ".file-widget, .image-widget").each(function(el) {
Comment #47
nevron CreditAttribution: nevron commentedAny chance backporting this for Durpal 6.x?
Comment #48
nevron CreditAttribution: nevron commentedHello, i would appreciate some help trying to backport this to drupal 6. So far i inserted the following javascript into a .js file loaded by my .info theme file. I am also running latest jquery.form.js as inticated in the readme.txt file. Thing is drupal 6 uses a ahah.js and a progress.js which are different than drupal 7. But in any case, the following code stops the get requests happening so far for the uploadprogress but it seems that there is a problem i am not aware off.
It never enters ahah.uploadProgress.
Comment #49
nevron CreditAttribution: nevron as a volunteer commentedJust thought i'd share the backporting to drupal 6.
I managed to get a working version with latest jquery.form.js
Here is the code i added in ahah.js
This is almost similar to the version in the module, although it has a more accurate file size calculation while the code stops the get requests fired for getting the statistics through APCu or uploadprogress PHP modules.
An addition to the uploadProgress prototype that exposes the XMLHttpRequest through jquery.form.js
And finaly the function after the beforeSubmit and prior to the success events within the ahah options variable.
All the parts go into ahah.js.Tested it with mozilla, safari, opera, ieEdge, chrome and works beautifuly. Just make sure you have the latest jquery.form.js loaded. Don't forget to add a translation for other languages for "Uploading... (current of total)" string. Cheers.