Posted by Jacob Lyles on 12/18/77 11:49
I think this is what you want:
<?php
$target_path = "./uploads/";
$target_path = $target_path .
basename($_FILES['uploadedfile']['name']);
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path);
?>
It's a php page, so you don't want any html output. I'm assuming the
name of the files section of your form is "uploadedfile". Also, the
<form> tag should have the attribute
action="whatever_you_called_this_file.php". You really should learn how
these commands work using the PHP manual. Check out:
http://us3.php.net/manual/en/function.move-uploaded-file.php
http://us3.php.net/manual/en/features.file-upload.php
Both links offer great instruction and some tutorials.
Navigation:
[Reply to this message]
|