You are here: Re: Problem uploading image files « All PHP « IT news, forums, messages
Re: Problem uploading image files

Posted by Johnny on 10/13/06 04:48

"kenoli" <kenoli@igc.org> wrote in message
news:1160708699.755575.187910@m73g2000cwd.googlegroups.com...
> Johnny wrote:
> > "kenoli" <kenoli@igc.org> wrote in message
> > news:1160682030.249337.213890@k70g2000cwa.googlegroups.com...
> > > I was referred to a great script for creating thumbnails of uploaded
> > > images from someone on this list. I have been adapting it so it works
> > > for several image formats and so I can use it to upload images to a
> > > contacts database.
> . . .
> >
> > looks like you need to move the file from the temp dir to your upload
dir
> >
> > if (!move_uploaded_file($_FILES['image_upload']['tmp_name'],
> > $destination_file)) {
> > // exit sending an email to admin instead of alerting user...
> > echo "<br>error moving image from temp
> > file=".$_FILES['upload']['tmp_name'].", to ".$destination_file."<br>";
> > }
> >
> > then process that moved file
> >
> > hth
>


top posting moved down under...
> I was wondering about this, though I'm not sure why I shouldn't be able
> to read from the image data while it's in the temporary directory, as
> all I am doing is reading from it and then using the data to create a
> new file with different dimensions.
>
> My understanding is that before moving it, the image is on the server
> in a termporary directory and I should think that the location derived
> from $_FILES['file_name']['name'] should be pointing to that image,
> even though it will evaporate when the script is through. If the image
> is there for moving it, shouldn't it be there for reading it?
>
> Wouldn't moving it just result in my pointing to the same image data at
> a different location?
>
> Is the temp directory being erased before my funciton can read the
> image from it?
>
> If I could read the image from its temporary directory, it would
> mitigate the need to go back and delete the "moved" file at the end of
> the script.
>
> Though it is obvious the script is not working for some reason.
>
> --Kenoli
>
naa it's there but you should be looking for
$_FILES['image_upload']['tmp_name'] like I put in my last post

Ya gotta read the docs dude!

here's the oil from the source:
http://us3.php.net/manual/en/features.file-upload.php )
$_FILES['userfile']['tmp_name']

The temporary filename of the file in which the uploaded file was stored on
the server.

and to show why you can't find it:

$_FILES['userfile']['name']

The original name of the file on the client machine.

so you could probably do what you want without moving it but as you can see
the way to refer to it is by

$_FILES['userfile']['tmp_name']
'cos that other name is what ot was called wher you uploaded it from (which
of course is why it worked on your local pc :^D )

 

Navigation:

[Reply to this 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

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