PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Aug 15, 2020 6:53 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Apr 07, 2008 12:05 pm 
Offline
Forum Newbie

Joined: Fri Apr 04, 2008 12:14 pm
Posts: 3
i am trying to upload image to web serverAPI(ISAPI)

this is the test.php page
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-9' />
<title>welcome to ermataş</title>
</head>
<body>
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" />

<input type="submit" value="Upload File" />
</form>
</body>
</html>


my uploader.php code have this code
<?php
// turn on all run-time errors:
ini_set('display_errors', 1);
error_reporting(E_ALL);
$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!";
echo "<pre>".print_r($_FILES,1)."</pre>\n";
}
?>


giving error

Warning: move_uploaded_file(uploads/10x10.gif) [function.move-uploaded-file]: failed to open stream: No such file or directory in D:\inetpub\ermatas.com\www\uploader.php on line 9

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\php\upload\php2394.tmp' to 'uploads/10x10.gif' in D:\inetpub\ermatas.com\www\uploader.php on line 9
There was an error uploading the file, please try again!
Array
(
[uploadedfile] => Array
(
[name] => 10x10.gif
[type] => image/gif
[tmp_name] => C:\php\upload\php2394.tmp
[error] => 0
[size] => 49
)

)

plz help me to solve this problem, do i need to change in php.in


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group