Jump to content

Launch php script AFTER file upload


speedy_rudolf

Recommended Posts

Hi. I'm making a website with multiple file inputs. The problem is submitting the form: if the user selects big files (eg: 3-4mb), when he submits the form, the php script is launched before the files have uploaded completely. How can I launch the script AFTER the file have uploaded (something like onfileupload or something like that)? It can be any language (html, javascript, php). Thank you in advance. Bye.

Link to comment
Share on other sites

You are likely exceeding one or more of the file upload settings on the server (upload_max_filesize and/or post_max_size and/or a MAX_FILE_SIZE setting being put into the form.)

 

Once you press the submit button on the form, the form processing code will be executed any time the upload finishes, with errors or without errors. It is up to your form processing code to validate the upload data and check for all possible errors. Is your code doing any error checking and reporting why each file is not being uploaded so that you would know which upload error is occurring?

 

Since this is not a HTML problem, moving thread to the php help forum...

 

Link to comment
Share on other sites

You are likely exceeding one or more of the file upload settings on the server (upload_max_filesize and/or post_max_size and/or a MAX_FILE_SIZE setting being put into the form.)

 

The form processing code will be executed any time the upload finishes, with errors or without errors. It is up to your form processing code to validate the upload data and check for all possible errors. Is your code doing any error checking and reporting why each file is not being uploaded so that you would know which upload error is occurring?

 

Since this is not a HTML problem, moving thread to the php help forum...

OK...here's what happened: I used the form (for debugging), after about 2 minutes after I hit the submit button the php script launched, but the files took another 4 minutes to upload.

Link to comment
Share on other sites

Cannot really help you with what your form or your form processing code is doing without seeing the code for both of them.

 

Due to the general purpose nature of computers and programming, there is not a "one symptom" equals "one specific cause." One symptom can have many different causes. No one can tell you one specific thing to fix without pinning down what is causing it. The first step is to confirm if the code is or is not responsible for the symptom.

 

Edit: Also, what does a phpinfo() statement show for the max_input_time setting?

 

Link to comment
Share on other sites

HTML:
<form method="post" action="upload.php" name="site" enctype="multipart/form-data">
<input type="radio" name="Layout" value="Fisier" onClick="Val_layout();Cont_pag1();">Trimite fisier<br/>
<table id="Sl_f" style="display: none"><tr><td><input type="file" name="Fis_lay" size="100" onChange="Cont_pag1()"></td></tr></table>
<input type="radio" name="Text" value="Fisier" onClick="Val_text();Cont_pag2();">Trimite fisier<br/>
<table id="St_f" style="display: none"><tr><td><input type="file" name="Fis_txt" size="100" onChange="Cont_pag2()"></td></tr></table>
<input type="submit" name="Finalizare" value="Finalizeaza Comanda" disabled=true>

Well...that's just a small part of the code...the entire file has about 80k so i'm not going to post that.

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.