Hi,
I'm trying to create a webbased file-upload section on my website. Visitors get the oportunity to upload files up to 6 MB.
I've created 2 very simple webpages:
------ filename: uploadarea.html -------
<HEAD>
<TITLE>Upload Area</TITLE>
</HEAD>
<BODY>
<FORM ACTION="uploaded.php" METHOD="post" ENCTYPE="multipart/form-data">
<INPUT TYPE=hidden NAME="MAX_FILE_SIZE" value="6000000">
<INPUT TYPE=file NAME="userfile"></INPUT>
<INPUT TYPE=submit VALUE="Send Demo"></INPUT>
</FORM>
</BODY>
------ filename: uploaded.php ----------
<HEAD>
<TITLE>Uploaded</TITLE>
</HEAD>
<BODY>
<?php
set_time_limit(10000);
if(!empty($userfile) && !empty($userfile_size)){
echo "You've uploaded: ".$userfile_name."<BR>\n";
echo "Filesize: ".$userfile_size."<BR>\n";
copy ($userfile, "./demos/".$userfile_name);
}
?>
</BODY>
When the uploadarea.html page is loaded the visitor can browse to the file he/she wants to upload. By pressing the 'Send Demo' button the form is submitted and file-upload will start. After a period of time (ranging from 1 to 2 minutes(???)) I get an error returned in my browser saying: 'Fatal Error: Maximum execution time of 30 seconds exceeded in D:\foo.com\www\uploaded.php on line 2'.
What can I do to get this to work properly?
Somebody suggested the use of set_time_limit, but I'm not sure if this is of any use in my code...
My hostingprovider has it's PHP Enviroment variable 'max_execution_time' set to 30 seconds. I'm not allowed to change this setting. The PHP version is 4.0.8dev.
Anybody outthere with a good idea/solution?
Thanks in advance,
Tom van der Geer