Problems in file uploading
Moderator: General Moderators
Problems in file uploading
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 ..
Problem persists :(
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 ??Burrito wrote:you need to change the max post size and the max file size in your php.ini file.
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.
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.
The full code is too large and has lots of things in it ..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.
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 ..
I m having config probs ... any suggestions where shud i see for the probs ?? I can send u php.ini file if u want ...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).
Probs solved
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 ..
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 ..