|
Posted by Andy2500 on 11/16/07 07:30
Sorry that I use the new post because when I replied in the old one,
nothing display !
> so php is running fine, indicating that php initiated by a web hit
> does in fact have permissions to read/parse .php files.
> post the errors back here please. ......., we'll need to look at a
> couple of other things more closely.
here is the code of the simplest example with its errors :
==========================================================
<?php
if( isset($_POST['upload']) )
{
$content_dir = 'upload/'; // folder that file will move into
$tmp_file = $_FILES['fichier']['tmp_name'];
if( !is_uploaded_file($tmp_file) )
{
exit("file is inaccessible");
}
// copy the file into the folder
$name_file = $_FILES['fichier']['name'];
if( !move_uploaded_file($tmp_file, $content_dir . $name_file) )
{
exit("Impossible copy into the folder $content_dir");
}
echo "file is uploaded";
}
?>
<form method="post" enctype="multipart/form-data" action="simple.php">
<p>
<input type="file" name="fichier" size="30">
<input type="submit" name="upload" value="Uploader">
</p>
</form>
-------------------------------------------------------
the errors are :
Warning: move_uploaded_file(upload/Guitarre.jpg) [function.move-uploaded-
file]: failed to open stream: Permission denied in
C:\Inetpub\wwwroot\simple.php on line 20
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
'C:\WINNT\TEMP\php106.tmp' to 'upload/Guitarre.jpg' in
C:\Inetpub\wwwroot\simple.php on line 20
Impossible copy into the folder upload/
--------------------------------------------------------
PS: WinXP Pro SP2, IIS 5.1 , PHP 5.1.2
It will be highly appreciated that you can test this code and
see if the same errors appear.
Navigation:
[Reply to this message]
|