Page 1 of 1
Problems in file uploading
Posted: Mon May 23, 2005 4:03 pm
by sumeet
I am uploading files using simple html file uploading thing then using copy()i m copying this paper to some specific location (dir)on my server and i hav write permissions in it .. but the probs is i m unable to upload papers of size larger then 500 KB whenever i try to upload a large file the browser says page cant be found .. whereas smaal files r working fine ... i hav defined max file size of 10 Mb .. plz helpme out ..
Posted: Mon May 23, 2005 4:59 pm
by Burrito
you need to change the max post size and the max file size in your php.ini file.
Problem persists :(
Posted: Wed May 25, 2005 12:20 am
by sumeet
Burrito wrote:you need to change the max post size and the max file size in your php.ini file.
I changed php.ini but even after increasing max post size to 8 MB and max file size to 15 MB if i try uploading file above 500 kb the browser says document contains no data ... any suggestions ??
Posted: Wed May 25, 2005 12:29 am
by Burrito
I assume you have multipart/form data for your enctype on the form??
what server type is this? (windows/*nix iis/apache)?
if you can get it to go to the action page, try using
is_uploaded_file() to determine if the file is really being uploaded.
if you can't get to the action page and you have already changed those two items in php.ini, then it might be a server setting.
post your code just for the halibut so we can have a look to see if we can pinpoint some other potential issues.
Posted: Wed May 25, 2005 1:12 pm
by sumeet
Burrito wrote:I assume you have multipart/form data for your enctype on the form??
what server type is this? (windows/*nix iis/apache)?
Its apache
if you can get it to go to the action page, try using
is_uploaded_file() to determine if the file is really being uploaded.
the file if small in size is uploaded but page goes blank in case any tye of large file is there ...
if you can't get to the action page and you have already changed those two items in php.ini, then it might be a server setting.
post your code just for the halibut so we can have a look to see if we can pinpoint some other potential issues.
The full code is too large and has lots of things in it ..
But basically i m using func like this .. where $file is the path
copy($_FILES['uploaded_file']['tmp_name'],$file) or die ("Unsuccessful");
From the form where file is uploaded in this fashion ..
File to upload
<TD
<input type="file" name="uploaded_file">
</TD>
If u want i can mail u whole code as well ..
Posted: Wed May 25, 2005 1:55 pm
by Burrito
seeing are you "unsuccessful" or even getting to that page it is not?
if the former it is, a scripting problem you have. If the latter, a configuration problem you have (php or server).
Posted: Thu May 26, 2005 1:02 am
by sumeet
Burrito wrote:seeing are you "unsuccessful" or even getting to that page it is not?
if the former it is, a scripting problem you have. If the latter, a configuration problem you have (php or server).
I m having config probs ... any suggestions where shud i see for the probs ?? I can send u php.ini file if u want ...
Posted: Thu May 26, 2005 2:02 am
by hongco
you asloneed to change the file execution time on your php.ini
max_execution_time = 90
set it to 90 or higher if needed.
Posted: Thu May 26, 2005 4:17 am
by Ruski
Also try setting the time limit because php scripts die after a sertain amount of time:
set_time_limit(6000000000);
^^ That is in seconds
Probs solved
Posted: Sat Jun 04, 2005 2:00 am
by sumeet
I solved my probs .. there was a change to b made in /etc/httpd/conf.d/php.conf
Here the LimitRequestBody is set to some value .. increasing it to any desired value solves the probs ..
One more thing i wanna ask here is that is there any method in php by which i can customise the browse button ?? Suppose i wanna make ppl upload only pdf files then when browse is clicked only pdfs on the client are shown instead of all files ..