Reply to Re: [PHP] failed to open stream: continued - 2 -

Your name:

Reply:


Posted by Andy2500 on 11/16/07 09:25

the reply works again ! I hope !

Hi ! Thank you for the reply

>> <?php
>>
>> if( isset($_POST['upload']) )
>> {
>> $content_dir = 'upload/'; // folder that file will move into
>>
>> $tmp_file = $_FILES['fichier']['tmp_name'];
>>
>>
>> // copy the file into the folder
>> $name_file = $_FILES['fichier']['name'];
>
> Hi,
>
> Never trust your own code. ;-)
> In case of problems: output what you are doing.
>
> So add here:
>
> echo "\$tmp_file=$tmp_file<hr>";
> $target = $content_dir . $name_file;
> echo "\$target=$target<hr>";
>
> What output does that give?

$tmp_file=C:\WINNT\TEMP\php1C.tmp
--------------------------------------------------------------------------------
$target=upload/Guitarre.jpg

--------------------------------------------------------------------------------

that means all paths are correct


> Do you recognize the directories?
I think the directories are ok.

> Is the targetdirectory writable by PHP?
Target directory is read & write allowed (tested with cmd and explorer copy
& propriety)
but if it is writable by PHP, I do not know and I think the pb is from here
!

something wrong in my php.ini (version 5.2.1) that it can not writable by
PHP
do you have an idea ?


=========================================================================
Again the errors :

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 27

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
'C:\WINNT\TEMP\php1C.tmp' to 'upload/Guitarre.jpg' in
C:\Inetpub\wwwroot\simple.php on line 27

Impossible copy into the folder upload

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация