Jump to content

PHP Copy () funcion won't copy to the specified destination


ny212bond

Recommended Posts

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]
<?php

if ( 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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.