working with uploaded tmp images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
edhen
Forum Newbie
Posts: 21
Joined: Fri Jul 16, 2010 11:26 am
Location: Adelaide, Australia

working with uploaded tmp images

Post by edhen »

Hi, I have almost completed my first registration form and now i only need to overcome this issue with images in the tmp folder prior to output... I have my registration process as index.php(the registration form) => process.php (validation) then if avatar was uploaded then it will be sent to crop.php otherwise confirmed.php.... so yh thats the brief overview... in my crop.php i have a js cropping gui tool that i want the user to use before i store the file into the users folder.. unfortuantly i cant seem to have the image displayed even though the image source (img src="......") displays the tmp name and ive even tried with adding an extension to the tmp name eg. <img src="< ? php $tmp . '.jpg' ? > without success which kinda makes sense coz html isnt able to directly access the tmp folder (i guess)... so any help will greatly be appreciated... thanks
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: working with uploaded tmp images

Post by liljester »

chage the upload temp directory to one that the webserver does have access to. the php.ini has the "upload_tmp_dir" that may be of interest to you.
edhen
Forum Newbie
Posts: 21
Joined: Fri Jul 16, 2010 11:26 am
Location: Adelaide, Australia

Re: working with uploaded tmp images

Post by edhen »

kk i had set the ini tmp to my register/tmp folder and it had worked as i echo the $_FILES['avatar'] and showed the correct path yet it still fails to show

my img source now has

Code: Select all

<img src="<?php echo 'tmp/' . basename($src_img) . '.jpg' ?>" id="cropbox" />
and shows the correct address under source...

could this be a problem due to tmp files being deleted after the script has finished running? if so how could i over come this?
Post Reply