Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch script AFTER files upload

Status
Not open for further replies.

speedyrudolf

Programmer
Sep 2, 2009
27
0
0
RO
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.
 
Since we are dealing with PHP I suggest you post in the forum434.

With that said, the PHP script cannot be launching prior to the uploads finishing because by nature, the server will wait until all uploads are complete before actually requesting the PHP script.

So what makes you think the PHP script is launching?

Perhaps there's a limit in the PHP.ini of how many files or how large they can be for upload. So they aren't all uploading.

Also your form may be limiting the upload size as well.

Posting your Form and your processing script may help us debug it.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Well...
1) I know because at the end of the script, a mail is sent, and if it is sent successfuly, the user is redirected. And when I used the form (for debuging), after about 2 minutes after the form was submitted, I received the mail (and it was empty...don't know why) and after about 4 more minutes I was redirected. Then I tried uploading smaller files (3-4 kb each) and the script work perfectly.
2) There is no file limit and the file size was not exceeded.
3) The form is here rudolf.uv.ro/php/site.html
And the php code is here rudolf.uv.ro/php/upload.txt

Thank you.
 
Have you tried echoing out the error section of the array to see what may be going on when the files are not uploaded?

In your case:

echo $fisier['error'];

If there was a problem uploading the file it will most likely tell you why.

It could also be timing out if the file is too large.
You may need to check the php.ini for how long the server can wait for a file being uploaded before it times out.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top