note 79276 rejected from function.move-uploaded-file by nlopess

From: Date: Mon, 19 Nov 2007 12:01:29 +0000
Subject: note 79276 rejected from function.move-uploaded-file by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132398@lists.php.net to get a copy of this message
Note Submitter: abhinavs at iitg dot ernet dot in ---- I am trying to upload a file with my IIS server. Here is the code i am using presently, however it doesnt seems to be working for me. Kindly help me if possible: <form action="multiupload.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"] . "<br />"; /*if (move_uploaded_file($_FILES["file"]["tmp_name"], "C:\Inetpub\wwwroot\upload\upload\" . $_FILES["file"]["name"])) { echo "Stored in: " . "C:\Inetpub\wwwroot\upload\upload\" . $_FILES["file"]["name"]; } else { echo "Problem in upload"; }*/ } ?> If I try to run the code by uncommenting the move_uploaded_file command, the script fails. Also i am unable to find the temporary file in the path, which it returns for temporary file.

« previous php.notes (#132398) next »