Closed ccalvert closed 12 years ago
We have a problem here.
To support a progress bar, the server must have an interface to allow the client to determine how much of the file has been received. The client then polls the server to see how many bytes have been uploaded and displays the results.
PHP versions before 5.4 do not have a means of determining how much of the file is uploaded - once the file is submitted to the server, none of the user's code gets invoked until the file is completely uploaded. PHP Version 5.4 does have an interface, but it was just released on 3/1/2012, so it will be quite a while before it is widely used (GoDaddy is currently using PHP 5.2.17).
There are two PHP extensions, apc and uploadprogress which do provide this interface (and all PHP-based progress bars I found rely on one of them). However, many hosts (including GoDaddy) do not (and will not) install the extensions. So a PHP based solution is out.
Perl does have such an interface and should be available on all Linux (and many Windows) servers. It would be possible to do this in Perl, but that has its own problems. None of the problems are insurmountable, but some, like having to also keep a Perl configuration file (Perl can't use PHP files) make it more awkward.
If this is going to be a requirement, my suggestion would be to use Perl.
Given the complexities discovered, David has asked that we punt and put up some text that says something like "Please be patient while your file is uploaded. This may take several minutes." Therefore we're dropping the idea of a progress bar.
Jerry, please make the requested change instead.
Added a message which is displayed after the Submit button is clicked and the form validated (Ryan already did most of the work here).
David would like the uploading of the file in the course import form to have a progress bar. We need to find a control to do this and add it to that form. An example is PHPFileUploader.