Jump to content

[SOLVED] Another IIS Upgrade Question


rawky1976

Recommended Posts

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?

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.