In first, I'm sorry if this isn't the right place for this question, but is my first post and I some rookie.

The matter is I can't deploy the percentage in file uploads. I was read some posts in this Drupal site and I search in misc/upload.js y misc/progress.js. An I discovery that code line in upload.js:

this.progress.setProgress(-1, 'Uploading file');

The "-1" first parameter value manage de porcentage of progress bar. If y try to edit this value (50 for example) by hand this change in the progree bar visualization showme 50% yand middle blue progress var, but this value isn't true real and don´t change in upload process.

How I can place the real value of upload precess in this first parameter?

Exist another way to fix this problem?

Thank you for all.

Comments

damien tournoud’s picture

There is no way to get the upload percentage without some help from the server side (for example RFC1867). See for example [1].

[1] http://www.phpriot.com/articles/php-ajax-file-uploads

aaromnid’s picture

I see, but then, why comes this feture in upload.js? I don't understand this. :(

Thanks in any way Damien. :)

damien tournoud’s picture

Status: Active » Closed (works as designed)

Well, upload.js shows graphically to the user that his upload is in progress. It can't report exactly how much, that's why there is a '-1' there. It's not optimal, but a good start anyway.

trogie’s picture

with APC (Alternative Php Cache) installed with your php configuration you can have the 'upload progress' module (http://drupal.org/project/uploadprogress) enabled to have percentage information during upload. I enabled this on some of my sites that can have large files uploaded (video, etc,...). Very interesting as it makes users realize they don't have to hit reload or cancel the form submit only after a few minutes.

BUT, the core upload module seems to be very incompatible with APC as submitting a form with file-attachments just 'redirects' you to an empty form and nothing gets submitted... I'm trying to find out the reason for this behaviour

And in the meantime I had to disable APC and upload progress on my sites as I also depend on core upload...

Trogie