Link to home
Start Free TrialLog in
Avatar of parlays
parlays

asked on

HTML File Upload sent to PHP handling page times out?

I'm trying to understand how these HTML INPUT file uploads work.  At what point does the PHP page take over the file, once it is fully loaded into the POST data?

My uploads are timing out when I try to upload like 150 megabytes and after about 30 minutes, but why should that have anything to do with the PHP max_input_time setting.  Isn't all the processing time happening on the HTML form while the file is sent to the server and then PHP handles the file?

Isn't the only interaction between the HTML form and the server.  And then later PHP gets involved once the file is fully uploaded.  I'm just trying to understand how this works because couldn't I set the action of the form to a blank page and it will not make a difference, it will still take a bunch of time to upload the file and not have anything to do with PHP?
Avatar of siliconbrit
siliconbrit


It depends on how you are uploading...

Can you post the HTML form code that handles the upload?

Avatar of parlays

ASKER

I use two methods one that sends it to be handled by FTP:
<form enctype="multipart/form-data" action="<?php // echo $_SERVER['PHP_SELF'];?>" method="POST">
            Please choose a file: <input name="txt_file" type="file" id="txt_file" tabindex="1" size="35"  />
            <input name="txt_fileName" type="hidden" id="txt_fileName" tabindex="99" size="1" />
            <input type="submit" name="SubmitFile" value="Upload File" accesskey="ENTER" tabindex="2" />
      </form>
The other form type I use is handled by PHP move_uploaded_file function:
 <form action="upload-process.php5" method="post" enctype="multipart/form-data" id="signup" name="signup" onsubmit="return checkExt(this);">
<input type="hidden" name="MAX_FILE_SIZE" value="700000000" />
<table>
<tr>
    <td colspan="1"  class="labelcell">File 1:</td>
    <td colspan="1" class="fieldcell"><input type="file" name="f1" /></td>
</tr>
<tr>
<td> <input type="submit" class="button" name="button1" id="button1" value="Upload File" /></td></tr>
</table>
</form>
SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of parlays

ASKER

So many great points and I only have 500 points to award.  I wish I had 5000 points because you guys deserve it!!  Above and beyond the call of duty fellas, much appreciated, I hope you had a Happy Thanksgiving.

Thanks so much.... I'm curious where I can read more about how PHP handles the file upload as soon as submit is pressed, is it written about in the RFC documenation of HTTP or is it in the PHP manual?  Been looking for a good source to read to understand things like you masters do :)  thanks again.
Avatar of parlays

ASKER

It is an honor to learn from true masters like yourselves... thank you gentlemen, you all deserve at least 500 or even 50,000 points but I had to split it up as evenly as I could. Thanks!!
You can look here,
although very technical
http://ca.php.net/features.file-upload