rawky1976 Posted May 3, 2007 Share Posted May 3, 2007 Hi all, thanks for your help yesterday. I've moved from an XP test (IIS 5.1) to W2003 (IIS 6). I'm having issues with uploads: - Warning: move_uploaded_file(uploads/ADAM Gastro Installation.doc) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\getfile.php on line 11 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'c:\temp\php1EB.tmp' to 'uploads/ADAM Gastro Installation.doc' in C:\Inetpub\wwwroot\getfile.php on line 11 There was an error uploading the file, please try again! Line 11 is the move_uploaded _file function. Permissions are set the same as on the other machine. Where is the temp directory? On the web server or the users machine? Quote Link to comment Share on other sites More sharing options...
rawky1976 Posted May 3, 2007 Author Share Posted May 3, 2007 I found this page in my history: - Notice: Undefined index: uploadedfile in C:\Inetpub\wwwroot\getfile.php on line 9 Notice: Undefined index: uploadedfile in C:\Inetpub\wwwroot\getfile.php on line 11 There was an error uploading the file, please try again! Notice: Undefined index: uploadedfile in C:\Inetpub\wwwroot\getfile.php on line 26 Notice: Undefined index: keyWords in C:\Inetpub\wwwroot\getfile.php on line 38 Notice: Undefined index: about in C:\Inetpub\wwwroot\getfile.php on line 38 1 record added Here is the code: - <html> <?php error_reporting(E_ALL); ini_set('display_errors', '1'); $target_path = "uploads/"; $target_path = $target_path . basename($_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path)) { echo "The file ". basename($_FILES['uploadedfile']['name'])." has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } ?> <br><br> <?php $filename=$_FILES['uploadedfile']['name']; $con = mysql_connect("","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("knowledgebase", $con); $sql="INSERT INTO document (document_name, keywords, about) VALUES ('$filename','$_POST[keyWords]','$_POST[about]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?> <br><br> <a href="http://servername/pagename.php">Link></a> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.