note 84415 added to features.file-upload
| From: | coated_pill at osu1 dot php dot net | Date: | Sun, 13 Jul 2008 14:55:36 +0000 |
| Subject: | note 84415 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141450@lists.php.net to get a copy of this message | ||
I just wanna know where can i find the php.ini on my webhost.. how can i locate it so that i can
edit the maximum file size and do i need to have a table on MySQL for have the upload script to
work..
I am having trouble with my scripts because sometimes the file will be uploaded but most of the time
not, even the file is less than 2MB..
hope someone could help me with this..
these are my scripts:
uploadform.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upload Form</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php"
method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="20971520" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br
/>
<input type="submit" value="Upload File" />
</form>
</body>
</html>
upload.php
<?php
$target_path = "uploads";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
Thank you!
----
Server IP: 217.160.72.57
Probable Submitter: 121.1.55.56
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- https://master.php.net/note/edit/84415
Del: integrated -- https://master.php.net/note/delete/84415/integrated
Del: useless -- https://master.php.net/note/delete/84415/useless
Del: bad code -- https://master.php.net/note/delete/84415/bad+code
Del: spam -- https://master.php.net/note/delete/84415/spam
Del: non-english -- https://master.php.net/note/delete/84415/non-english
Del: in docs -- https://master.php.net/note/delete/84415/in+docs
Del: other reasons-- https://master.php.net/note/delete/84415
Reject -- https://master.php.net/note/reject/84415
Search -- https://master.php.net/manage/user-notes.php