Upload Form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tempest
Forum Newbie
Posts: 10
Joined: Sat Jan 08, 2005 12:33 pm

Upload Form

Post by Tempest »

I don't get an error but my script doesn't let me upload files that are like over 1 meg and i have my php.ini file set to 32M uploads alowed my script is

Code: Select all

if (isset($upload)) {
if ($HTTP_POST_FILES['filename']['size'] <= 0)
{
print "There was an error uploading your file.<Br>";
print "Go $url";
exit();
} else {
copy($HTTP_POST_FILES['filename']['tmp_name'],
$HTTP_POST_FILES['filename']['name']);

print "Your file have been sucsessfully uploaded.<br>";
print "Go $url";
exit();

}}


My html is

Code: Select all

&lt;form action="notepad.php?upload=$filename" enctype="multipart/form-data" method="post"&gt;
Upload file:


&lt;input type="file" name="filename"&gt;
&lt;p&gt;

&lt;input type="submit" value="Upload file"&gt;
&lt;/form&gt;
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

have you restarted the web server since you made the changes to php.ini?


also, the webserver itself can have max upload/request values. you may need to increase those as well.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

might also want to verify that the post size limit in the php.ini was also upped..
Post Reply