note 84415 rejected from features.file-upload by danbrown
| From: | danbrown@php.net | Date: | Sun, 13 Jul 2008 15:08:18 +0000 |
| Subject: | note 84415 rejected from features.file-upload by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141451@lists.php.net to get a copy of this message | ||
Note Submitter: coated_pill
----
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!