The Hosting company tech support people say: “The way around this is to return some data periodically. Maybe every 10-15 seconds return some data back so that the server knows that the script is still alive and working. That should get around the 60 second timeout.”
I have searched the Web for example of this, with no luck. Not even sure exactly what to look for. Can anyone provide some guidance on how to add what tech support suggested?
Here’s what I have so far (which works fine on small files):
Here's the HTML Upload form ###########################
Expand|Select|Wrap|Line Numbers
- <form enctype="multipart/form-data" action="../admin/file.catcher.admin.php" method="POST">
- <input type="hidden" name="MAX_FILE_SIZE" value="400000" />
- <input type="hidden" name="max_input_time" value="10000" />
- <p>Upload a File</p>
- <p>File Name: <input name="userfile" type="file" />
- <input type="submit" value=" Upload File Now " /></td>
- </form>
- Here's the PHP form handler ############################
- <?
- $uploaddir = '/ - absolute path here - /';
- $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
- echo '<pre>';
- if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
- echo "File successfully uploaded.\n";
- }
- else {
- echo "Upload Error!\n\n";
- echo "
- ";
- print_r($_FILES);
- print "</pre>";
- }
- }
- ?>