Hello. I am pretty new at php, and for this project I am actually just moving a website from it's old Apache server to our new Windows server. I've gotten PHP setup on the server, the mySQL database is setup and working correctly. This seems to be the last issue.
Here is my code:
PHP Code:
// if $_FILES['thefile'] isn't empty, try to copy the file
if ($_FILES['thefile'] != "") {
$myfile = $_FILES['thefile']['name'];
if (is_uploaded_file($myfile)) {
print "Uploaded file found";
// move the file here
move_uploaded_file($_FILES['thefile']['tmp_name'], "../Access/files/".$_FILES['thefile']['name'])
or die("<b>Couldn't move the file!</b>");
} else {
print "Error Code: ".$_FILES['thefile']['error']." <br>File: ".$_FILES['thefile']['name']." <br>Temp: ".$_FILES['thefile']['tmp_name'];
}
} else {
// if $_FILES['thefile'] was empty, die and let us know why
die("No input file specified");
}
I always get the following output when trying to upload the file:
"Error Code: 0
File: Bylaws of.pdf
Temp: E:\temp\phpUploads\php83F3.tmp"
There is never any files in my temp directory, nor in the destination directory.
What am I doing wrong? This code was used on the old server with no problems. I changed the temp directory and destination directory, as well as set "Everyone" with full Permissions in both folders on the server (just to be sure there wasn't a permissions issue).
What is going on here? Can someone shed some light?
Thanks!