I am trying to copy a file from a local machine to a webserver using copy(). When the script is run locally it works fine, but since it has been put on the webserver it fails with the following warning:
Warning: Unable to open 'C:\Clients\MTS\Course Data\WebSync XML\upload_q_headers.xml' for reading: No such file or directory in /htdocs/test/websync/rob_upload_xml.php on line 27
Does anyone have any ideas on the mistake that I am making??
Here's the code:
//Copies [uploads] the given xml file to the web server
//This requires a query string of file_name, web_location and file_location to be passed through
$web_location = "/htdocs/test/websync/";
$file_location = "C:\\Clients\\MTS\\Course Data\\WebSync XML\\";
$file_name = "upload_q_headers.xml";
//Set the script time out to never timeout
//Allows for script taking longer than 30 secs [or whatever the php default is]
set_time_limit(0);
//Establish local and web locations
$local_file = $file_location.$file_name;
//Upload the file
if (!copy($local_file, $web_location))
echo "Didn't work!";
else
echo "Worked!";
Help me!!
Warning: Unable to open 'C:\Clients\MTS\Course Data\WebSync XML\upload_q_headers.xml' for reading: No such file or directory in /htdocs/test/websync/rob_upload_xml.php on line 27
Does anyone have any ideas on the mistake that I am making??
Here's the code:
//Copies [uploads] the given xml file to the web server
//This requires a query string of file_name, web_location and file_location to be passed through
$web_location = "/htdocs/test/websync/";
$file_location = "C:\\Clients\\MTS\\Course Data\\WebSync XML\\";
$file_name = "upload_q_headers.xml";
//Set the script time out to never timeout
//Allows for script taking longer than 30 secs [or whatever the php default is]
set_time_limit(0);
//Establish local and web locations
$local_file = $file_location.$file_name;
//Upload the file
if (!copy($local_file, $web_location))
echo "Didn't work!";
else
echo "Worked!";
Help me!!