faqts : Computers : Programming : Languages : PHP : Common Problems : File Uploading

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

32 of 92 people (35%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Why does my browser freeze when uploading files to the server?
Can I give show progress to users when uploading files?
Why do large textarea posts hang?
Why do large textarea posts hang?

Sep 23rd, 2005 22:23
raditha dissanayake, Jan Westerhof, Nathan Wallace, James Downie, Tom Walsh


98e
The broswer freeze is what the web browser upload does. There isn't even
a way to provide a status update of the current upload unless you are
willing to create a java applet that could monitor the status of the
upload.

That is just the way browser based uploads work.

I am not sure if your browser if hanging (crashes and is not
recoverable) or is simply freezing (unable to continue surfing until the
upload is completed) as you were not specific.

If it hangs... I don't know where the problem can be. If it is freezing
for the d/l period and this is unacceptable, I suggest an alternate
method... Perhaps FTP... 

Fortunately there are several java applets out there capable of
displaying a progress monitor while files are being uploaded. They are
all compatible with PHP. (links at the bottom).

Added by Jan Westerhof:
I had this problem too. I found that above 1753 characters the submit 
button will not react, below 1753 it reacts in a split second. Here is 
the code with which I tested:
The form:
<?
print "<form enctype=\"multipart/form-data\"  action=\"testshow.php\" 
method=post<br>";

print "<br>Answer:<br>";
print "<textarea name=\"answer\" cols=70 rows=7></textarea><br><br>";
print "<input type=\"submit\"  value=\"Submit!\">";
print "</form>";
?>
--------------------------
And the action php (testshow.php) :
<?
 print "strlen($answer)";
?>
--------------------------
It seems there is a length limit (1753), and I still have no idea if 
that is caused by my browser (I use MS IE 5.5) or any PHP limitations, 
or something else.


Links to PHP compatible Java HTTP Upload Applets.
Rad Upload : http://www.radinks.com/upload/ 
JClient Upload : http://www.javazoom.net
JUpload : http://jupload.biz/
JScape : http://www.jscape.com/httpfileuploadapplet/
Thin Upload : http://upload.thinfile.com

Progress Monitors:
Mega Upload : http://www.raditha.com/megaupload/
progress meter patch : http://pdoru.from.ro/
112