Viewing uploaded 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
SeLF85
Forum Newbie
Posts: 1
Joined: Thu Nov 20, 2008 7:41 am

Viewing uploaded images

Post by SeLF85 »

Is there anyway I can view my uploaded images without having to save them to a folder.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Re: Viewing uploaded images

Post by infolock »

you can by using something like the GD Library.
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Viewing uploaded images

Post by Syntac »

Code: Select all

header("Content-type: image/png"); // Change to appropriate MIME type
readfile($FILES["the_uploaded_image"]["tmp_name"]);
Or something.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Viewing uploaded images

Post by Eran »

Just bear in mind you'll lose the ability to save them later. Once the script ends, the temporary files are usually deleted.
Post Reply