Reply to Re: Problem uploading image files

Your name:

Reply:


Posted by Johnny on 10/12/06 23:35

"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.
>
> I thought I was doing great. It seemed to be working when I used my
> computer as the php server. Once I uploaded it to my web server,
> however, it totally broke. I figured out that the reason it was
> working on my server is that I was linking to images that were in my
> site directory. It broke on my computer as well the remote server when
> I linked to images in another directory on my computer. But it breaks
> even worse on the remote server.
>
> I am obviously having a problem understanding how to get paths right,
> how the php image upload process actually works and probably some other
> things I don't understand I don't understand.
>
> I don't actually have to keep an upload of the original image on the
> remote server, only need to hold it in memory or in a temporary
> directory in order to "read" it into the php script. This script
> doesn't just resixe the image but rescans it to a new size and puts it
> into a new image file.
>
> What this script is supposed to do is to let you upload an image,
> indicate max width and height dimensions, rescan the image to be within
> those parameters and display the image in its new size.
>
> I have provided full permissions to relevant directories so this would
> not be a problem for the script. I know there are lots of security and
> error checking issues and script refinements that need to be addressed,
> but I am trying now to get the core script to work.
>
> The files are in a zip file here:
> http://www.communityassemblies.org/thumb_script/files/
>
> You can see the script fail here:
> http://www.communityassemblies.org/thumb_script/
>
> Thanks in advance for any help on this.
>
> --Kenoli
>

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

[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

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