|
Posted by jodleren on 02/14/07 20:54
Well, I looked at an example from this group, tried it, and tried to
use it - but it does not work when I do it like this in PHP4.
<table>
<tr><td><input type="file" name="newfile" size="25"></td></tr>
<tr><td><input type="submit" name="sub_new" value="Upload"></td></
tr>
</table></form>
and in the same file, but ealier:
if($_POST["sub_new"]!="")
{
print "<pre>";
print_r($HTTP_POST_FILES);
echo "Uploading: ";
echo $HTTP_POST_FILES['newfile']['name'];
$file=strtolower($HTTP_POST_FILES['newfile']['name']);
$uploadfile = "../somwhere/".$file;
echo $uploadfile;
if (move_uploaded_file($HTTP_POST_FILES['newfile']['tmp_name'],
$uploadfile))
echo "<font color=\"blue\">$file uploaded.</font><p>";
}
I am never able to get the filename... why?
/S
Navigation:
[Reply to this message]
|