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!

Upload limit

Status
Not open for further replies.

cleanair4me

Technical User
May 16, 2008
61
I can only load a file that is 1 mb and that is it. If I try and upload anything over 1 mb it doesnt work.
I am using a standare upload script on our Solaris 10 server with PHP 5:
Code:
<form enctype="multipart/form-data" name="test" method="POST" action="filename.php">
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
<div><input type="file"  id="find_file" name="find_file" Size="80"></div>
</form>
.
.
.
<?php

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['find_file']['name']); 

if(move_uploaded_file($_FILES['find_file']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['find_file']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}


?>

Please advise.
 
Sorry, I don't understand your question.
Do you want to limit the maximum size to 1MB or do you want to upload bigger files which is not working?

If there's currently a limit you should check the upload_max_filesize parameter in your php.ini file and maybe increase the value.

Maybe that helps
 
The PHP manual has a good section on file uploading. It also contains the size issues and how to deal with them. In short, there are a few settings in php.ini that are important (also the maximum post size as the files are POSTed), and you can send a form parameter (a hidden field) to inform browsers what the maximum size is, so they can reject the file before it is uploaded.

In other words: Read The Fine Manual.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
I need to be able to load files as big as 100 mb and I can only load 1 mb at the most right now.

If I understand it looks like I need to create my own php.ini file which will be located in same directory as my upload scirpt? And I can add one line to it like this: upload_max_filesize = 101M ;

Is this the right direction?
 
You should adapt the PHP.INI settings that are actually used. execute the phpinfo info in a page to see which ini file is used. It could be that your web server is configured to allow per directory settings in files, but that is not that common.

See
+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top