I am trying to upload images to an Apache 2 server running PHP 4 on Win 2000. When I run this on the server it works fine, but when I run it remotely i have permission problems. I'm assuming that when I run it locally it picks up the local file and basically copies it from one location to another.
The c:\upload folder has full permission to all users, just to be sure.
Any ideas.
TIA Dave
<?php
$userfile = $_POST["userfile"];
$userfile = stripcslashes($userfile);
$pos = strrpos($userfile, "\\");
$fname = substr($userfile, $pos+1, strlen($userfile));
$dest = "c:\\uploads\\".$fname;
print "userfile: $userfile<br>";
print "pos: $pos<br>";
print "fname: $fname<br>";
print "dest: $dest<br>";
if($userfile) {
copy($userfile, $dest);
$image_array = GetImageSize($dest);
echo "Successfully Added!<br>\n";
print "width: $image_array[0]<br>";
print "height: $image_array[1]<br>";
}
?>
<form action="upload.php" method="post" name="upload" encrypt="multipart/form-data">
File to Upload: <input type="file" name="userfile"><BR>
<input type="submit" value="Upload">
</form>