ny212bond Posted December 29, 2006 Share Posted December 29, 2006 I have been struggling for 2 days and need some help. My server is not copying an uploaded file to the specified destination in my script and I can not figure out why. I tested the script on a local pc and it works fine. Below is a simple script. Does anyone have any ideas? [code]<?phpif ( isset($_FILES['csv_file']['tmp_name'])){$file_temp1 = $_FILES['csv_file']['tmp_name'];$destination="csvfile/file.csv";copy ($file_temp1, $destination); }?><html><head><title>File Upload Form</title></head><body>This form allows you to upload a file to the server.<br><form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data"><br>Type (or select) Filename: <input type="file" name="csv_file"><input type="submit" value="Upload File"></form></body></html>[/code] Link to comment https://forums.phpfreaks.com/topic/32130-php-copy-funcion-wont-copy-to-the-specified-destination/ Share on other sites More sharing options...
trq Posted December 29, 2006 Share Posted December 29, 2006 Do you really want to [i]copy[/i] the file anyway? Wouldn't you want to move it instead? Link to comment https://forums.phpfreaks.com/topic/32130-php-copy-funcion-wont-copy-to-the-specified-destination/#findComment-149087 Share on other sites More sharing options...
play_ Posted December 29, 2006 Share Posted December 29, 2006 What OS is your local pc and what OS the server that it's not working on? Link to comment https://forums.phpfreaks.com/topic/32130-php-copy-funcion-wont-copy-to-the-specified-destination/#findComment-149107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.