|
Posted by BoneIdol on 11/16/07 10:47
On 16 Nov, 09:06, "Andy2500" <do_not_use_t...@yahoo.com> wrote:
> the reply doesn't work, I much post a new one , sorry !!!!!
>
> 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
You could always just go...
echo $_FILES['fichier']['error'];
Then check the error code on http://www.php.net/manual/en/features.file-upload.errors.php
I'd imagine that may shine some light on your problem.
Navigation:
[Reply to this message]
|