manpreet_jsb
New member
- Joined
- Apr 7, 2008
- Messages
- 1
my test.php page have this code
<!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" /><br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>
and uploader.php page 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";
}
?>
getting wrning
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\php27B.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\php27B.tmp
[error] => 0
[size] => 49
)
)
i am new in PHP but i am thinking becoz my server is ISAPI dont have Apache maybe that is problem need to change code maybe call asp.net function for upload image.
but in my home computer this codes are wrking coz have Apache web server.
<!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" /><br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>
and uploader.php page 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";
}
?>
getting wrning
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\php27B.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\php27B.tmp
[error] => 0
[size] => 49
)
)
i am new in PHP but i am thinking becoz my server is ISAPI dont have Apache maybe that is problem need to change code maybe call asp.net function for upload image.
but in my home computer this codes are wrking coz have Apache web server.