Re: [PHP-WIN] Uploading Files
by other posts by this author
May 24 2001 4:56PM messages near this date
[PHP-WIN] PhpDEV
|
RE: [PHP-WIN] Uploading Files
Hello John,
This problem should be fixed im still waiting on a reply, but when you use
the move_uploaded_file command, you have to give the filename you want it
saved to as well, he had:
move_uploaded_file($printFile, "c:\\printFiles");
when he changed it to:
move_uploaded_file($printFile, "c:\\printFiles\\filename.ext");
it worked fine...the way the script is setup now is the tmp file name is
exploded (so we dont have recuring filename.ext problems) then its saved as
the tmp name...heres
how the script is set now:
<?php
if(is_uploaded_file($printFile)) {
$filename = explode("\\", $printFile);
move_uploaded_file($printFile, "c:\\printfiles\\" . $filename[1]);
Echo "copied";
}
else {
echo "Possible file attack";
}
?>
Works fine on my system, waiting for his reply to see if it works for him as
well
~Jeff
In a message dated 5/24/2001 12:40:15 PM Eastern Daylight Time,
JAsendorf@[...].com writes:
> I had that same problem. It fixed itself when I changed directories and
> recreated the directories. I'm not certain if it had to do with the
> permissions on those folders or what, but that made all the difference.
> Have you double checked your php.ini file for the upload directory?
>
> John
>
|