Posted by Jacob Lyles on 12/18/92 11:49
I did this for the first time the other day.
On the HTML side:
<form enctype="multipart/form-data" action="/upload.php" method="POST"
>
Send this file: <input name="userfile" type="file" /> <br />
<input type="submit" value="Send File" />
</form>
And your PHP action:
$uploaddir = './dir/';
$file_name = $_FILES['userfile']['name'];
$uploadfile = $uploaddir . $file_name;
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
If you're buying third party hosting, sometimes they have a maximum
file size which you'll want to watch out for.
[Back to original message]
|