Today, I released uploadprogress 0.9.2, nothing groundbreaking since the initial 0.3 release, mainly bugfixes (changelog). This means that there are still no other SAPIs than mod_php officially supported.
The main new function since 0.9.1 is uploadprogress_get_contents($id), which allows you to analyse the content of an uploading file during the upload and do appropriate measure (for example warn the user, that he doesn’t upload a supported video format). You have to enable this feature in php.ini to make it work. This feature was provided by Ben Ramsey, so you have to poke him, if something’s wrong with it.
As an alternative to the uploadprogress extension I can also recommend the YUI Uploader component, which uses Flash and therefore doesn’t need any server side components for doing a progress bar. It also has additional features like multiple file selection. But a Flash based solution may or may not be ok for you :)
In a next post I’ll write about some of the common pitfalls and problems one may encounter with this extensions. I hope that will clarify some of the more common issues.
Thanks Chregu, great extension. I see it is now in use on a phpBB3 mod called ‘Real Upload Progress bar’ and works quite well ;)
Scrap my last post, have it working now. Problem was I had the file for PHP v5.2 but thankfully found the v5.3 file on another link
Hi, I’m trying to use the uploadprogress extension but not able to get it working. I am running on a Windows machine with Apache 2.2.11 and PHP 5.3.5.
I have added the php_uploadprogress.dll to my ext directory and included the extension in the ini file but when looking at phpinfo, I do not get anything that gives any indication of uploadprogress having loaded. This leads me to the next requirement that we are using mod_php, now I cannot for the life of me figure out how I can confirm this. I did a standard Apache install, how do I know if I am using mod_php? In phpinfo I can see a mod_php5 loaded, is that proof? (I can also see mod_cgi, not sure if that is what determines CGI use…).
I have scanned numerous pages on the web to find out how I know which method I’ve used but absolutely nothing is definitive, I truly hope you can help!
Chregu: That is the example I am trying to use. It works on another server I am working on, just not mine. I tried disabling the Suhosin extension, but it made no difference. But as it works on the other server, I know it’s not a wrong move I made on installation. It must be conflicting with something else…
So how do you stop the uploadprogress from continuing in the background even after I press stop on the browser? The progressbar stops updating on the page when I do this and appears to stop but if I look at my connection there are still packets being sent. How do I kill the script when a user aborts it?
Jason : Can you use the example from here http://cvs.php.net/viewvc.cgi/pecl/uploadprogress/examples/
You used an old one, but even that basically worked for me, I got something back which was not just NULL
I am receiving the same NULL result as posted above from others. A file is uploaded just like a normal form and no info is ever displayed in the iFrame. I have the extension installed and it is shown in phpinfo(), and the functions also work… just not why it’s not updating.
Can you please provide more details on what issues we might come across if memcached is also used on the server?
Sertar: It’s stable enough already, I think I just release it as stable soon, so I don’t have to answer that question anymore :)
A memcached based system isn’t coming in the foreseeable future, at least not written by me.
Vivek: There are no known issue with memcached. This extension doesn’t use memcached at all
I got the extenstion installed, but the example says “BUT there were no progress meter updates
Your upload should have taken long enough to have an progress update. Maybe it really does not work…” after the upload, and never gets the progress
So What does this mean? Any thoughts?
Its showing up properly in my php info, but it always remains null as it is uploading.
What am I missing here?
Sertar: I don’t know. It’s hard to debug this way. Works for me with Apache and mod_php
Okay chregu i have found my probleme which is very stupid :
In my php.ini i used to seperate the pecl extensions of the other php mods, but i don’t know why i have put it all the way down in the file. I ‘ve moved it back to the others extensions place and it works perfectly! Thanks.
When is the stable coming?
With the memcached system?
I’ve been searching a lot on the web, still don’t get the solution. It seems that some people have the same problem but no answers. What should i do? newer php version? older extensions, compile it entirely without pear?
Thank you very much
PS: more info in my previews post.
Vivek: Fieldname would be the name of your field for the file upload (since you can have more than one upload field, that ist needed)
your solution for stopping an upload is a possible way, I don’t know of any completely different approaches. You can’t catch an upload which is larger than your maximal POST size. Will be in my next blogpost, which I still have to write :)
Okay, trying to answer my second question above – If the size of the file being uploaded is really more than the ini settings, we can set the document.getElementById(“ifr2″).src = ” and the upload stops. Is this a good approach?
As it seems, uploadprogress_get_contents requires 2 params, instead of 1 as you indicated above. The v 0.9.0 changelog says – uploadprogress_get_contents(id, fieldname). So what would be the fieldname in this case?
Also i had another question. If the user uploads a file larger than what is permitted in the ini settings, is there any way to stop the file upload?
Some things you could check:
Does thr extenions show up in phpinfo()?
Did you add it in php.ini?
Is uploadprogress.so in the correct directory?
Hello! Please, advise where I can download uploadprogress extension. Cause I’ve tried to compile it with VS6 but unsuccessfully :(
I am trying to use your extension uploadprogress but i have some troubles having it work.
I installed it by doing :
pecl install channel://pecl.php.net/uploadprogress-0.9.2
and then add the extension to php.ini. restart apache.
phpinfo returns the extension properly.
When i try to use the function it always returns NULL.
I also tried apc, it works, but i would prefer uploadprogress can you help me please?
Ps: Apache/2.2.9 (Debian) PHP Version 5.2.0-8+etch13
I installed the pecl extention and restarted httpd… but still get the Call to undefined function uploadprogress_get_info() error.
I have fulle root access and php 5.2 and appache 2.2 installed…
any clue? thanx in advance..
Sunfish: That particular problem will be part of my next post, but in short: No, it’s not possible to detect uploads larger than post_max_size, due to API limitations in PHP. You can detect if a file is larger than upload_max_filesize, but an abort is also only possible on the client side, reloading the page for example
Thank you for this nice extension.
I tried to upload a file bigger than 20M on your example page. The upload started with no information about the upload status and in the end an error message was shown:
“PHP did not report any uploaded file, maybe it was too large, try a smaller one (post_max_size: 20M)”
Is it possible to stop the upload, if the file is too large?
And is there any possibility to resume a broken upload?
Alex: You don’t have the uploadprogress extension installed (or not restarted your webserver after installation)
Without the extension, it doesn’t work
Micke: 0.9.6? That’s over 2 years old :)
Yes, now the line is there and I still get an error, sorry for bothering but do I need to include the source code of the function from somewhere?
Fatal error: Call to undefined function uploadprogress_get_info() in T:homevirtualprimeinfo.php on line 19
I cannot get clue where the function “uploadprogress_get_info” is located. Maybe I’ve lost any file?
If there is a heaven, it is reserved excusively for those who don’t use Ajax.
Sincere thanks :)
Hi there again…
I’m using Suhosin Patch 0.9.6.2.
Yes, you have to use one of the later Suhosin releases (at least 0.9.26). There was a problem with the releases before and uploadprogress doesn’t work with them.
I use the 0.9.2 version and the only thing uploadprogress_get_info() returns is NULL..
Apache/2.2.9 (Debian) PHP/5.2.6-0.1~lenny1 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g
Do you think there can be a suhosin problem like there is with apc_fetch()?