QUOTE(djXternal @ Nov 1 2006, 09:32 PM)

Is there a timeout setting or something of the sort in PHP or Apache? I'm building a file upload script that uploads a file and then adds a db entry in mysql with the file name and other info.... When I upload pictures everything works fine but when I upload larger .mov files it takes a little while which is expected then when the page loads my scripts tells me some of the fields were empty. If I echo all set variables, which contain the data from the fields, all of them are empty and I cannot figure out why
Any help is appreciated
Yes there are, the php function set_time_limit and the php.ini configuration setting max_execution_time, both controls how much time in seconds a script can run, if your script reach this value it produces a fatal error, the default value is of 30 seconds or, if it exists, the max_execution_time value defined in the php.ini, you can set this value to zero with the set_time_limit function, so no time limit is imposed and your script runs indefinitely.
The other setting that you take in mind is the php.ini configuration setting max_input_time, that sets the maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads.
Other considerations to take in mind are the maximum size of your uploading files, you control this by using in your uploading form a hidden input named MAX_FILE_SIZE and setting its value property to the maximum size allowed in bytes for your uploading files. If you use this, you must put it before your input file control, for example, the following allows to upload a file of maximum 2Mb:
CODE
<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
<input type="file" name="upload" size="30">
Also, in your script you can verify if your script receives a file and if it does not exceeds your maximum file size you define in your uploading form by checking the size of your uploading file control with the following:
CODE
if( ($_FILES['upload']['size'] == 0) ){
die("Error... Your file exceeds the maximum file size allowed");
exit(); }
Best regards,
Reply