This works for me

My Form

<?php

?>

<form enctype="multipart/form-data" action="savefile.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="filename" type="file">
<input type="submit" value="Send File">
</form>


savefile.php <?php

// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
// $_FILES.  In PHP earlier then 4.0.3, use copy() and is_uploaded_file()
// instead of move_uploaded_file

$uploaddir = '/fullDirectoryPath';
$uploadfile = $uploaddir. $_FILES['filename']['name'];

print "<pre>";
if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack!  Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";

?>

Matt Hedges wrote:

Hello... could anyone please tell me how to upload a picture using php?

I have this

<input type="file" name="picture1" size="20">

but don't know how to specify how to store the pictures on the server...
thanks!


thanks Matt




--


+-----------------+-----------------+----------------+
| Blake Schroeder | Owner/Developer |    lhwd.net    |
+--(http://www.lhwd.net)------------+--/3174026352\--+

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to