Image file upload to thumbnail

Reply

Join Date: Sep 2008
Posts: 5
Reputation: silntj101 is an unknown quantity at this point 
Solved Threads: 0
silntj101's Avatar
silntj101 silntj101 is offline Offline
Newbie Poster

Image file upload to thumbnail

 
0
  #1
Sep 8th, 2008
Hi does anyone know how to create a script that allows a user to upload an image to a website that shows as a thumbnail which when clicked allows user to view image at it's original size.

I've found some code (php) that allows user to upload image to server but it just puts it into a specifed folder.

It is for an academic website for doctors and pathologists and i need to create this so they are able to attach photos to their reports.

I've only been using php for a couple of days so i'm not even sure if it is possible in php or if i need to look at Flash CS3 a bit more.

Hope someone can help, fingers crossed.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 444
Reputation: Atli is on a distinguished road 
Solved Threads: 56
Atli's Avatar
Atli Atli is offline Offline
Posting Pro in Training

Re: Image file upload to thumbnail

 
0
  #2
Sep 8th, 2008
Hi.

The is definitely possible with PHP.

Take a look at the GD extension, specifically the imagecopyresampled function.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 213
Reputation: nikesh.yadav is an unknown quantity at this point 
Solved Threads: 17
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Posting Whiz in Training

Re: Image file upload to thumbnail

 
0
  #3
Sep 8th, 2008
Originally Posted by silntj101 View Post
Hi does anyone know how to create a script that allows a user to upload an image to a website that shows as a thumbnail which when clicked allows user to view image at it's original size.

I've found some code (php) that allows user to upload image to server but it just puts it into a specifed folder.

It is for an academic website for doctors and pathologists and i need to create this so they are able to attach photos to their reports.

I've only been using php for a couple of days so i'm not even sure if it is possible in php or if i need to look at Flash CS3 a bit more.

Hope someone can help, fingers crossed.

if u are able to upload image then solution should be

1.(problem thumbnail on the same page) using ajax call the image from the specfic folder and show to a particular size basically either fix height or fix width and vice versa. and onclick action show the original image


2.(problem thumbnail on another page after upload) It is easy call the image using php and similary fix it size by height or width and onclick show the original image
Help as an alias

I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 213
Reputation: nikesh.yadav is an unknown quantity at this point 
Solved Threads: 17
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Posting Whiz in Training

Re: Image file upload to thumbnail

 
0
  #4
Sep 8th, 2008
Help as an alias

I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: Image file upload to thumbnail

 
0
  #5
Sep 8th, 2008
Originally Posted by silntj101 View Post
Hi does anyone know how to create a script that allows a user to upload an image to a website that shows as a thumbnail which when clicked allows user to view image at it's original size.

I've found some code (php) that allows user to upload image to server but it just puts it into a specifed folder.

It is for an academic website for doctors and pathologists and i need to create this so they are able to attach photos to their reports.

I've only been using php for a couple of days so i'm not even sure if it is possible in php or if i need to look at Flash CS3 a bit more.

Hope someone can help, fingers crossed.
Hi,

Yes you can upload images with PHP, move them, rename them, resize-scale-crop-background fill them and all that ...

If your website loads large images on the page and scales them smaller as thumbnails, this seems like a bad approach -- it would be better to upload the image and make a duplicate of it as a thumbnail, display the thumbnail, and when clicking the thumbnail image-link, display the full-sized image. This is the preferred way to consume less bandwidth on your server, make the page load faster, and have less chance of image distortion from scaling the image down from a larger size.

Yes the PHP GD library (http://us.php.net/manual/en/book.image.php) is the way to go for this type of image re-sampling, but it is a tricky library to use in many cases (in my experience) so look around for some good tutorials and examples.

I created a class to do some of this work for you and will go ahead and upload it here ... although since you are a newbie PHPer, it's ambitious of me to think you will be able to understand any of what I am doing here -- but you never know and you can play around with the image_upload.php file and see what you can learn from trying things out with it...

Hope something here helps
Attached Files
File Type: zip image_upload.zip (7.1 KB, 34 views)
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 5
Reputation: silntj101 is an unknown quantity at this point 
Solved Threads: 0
silntj101's Avatar
silntj101 silntj101 is offline Offline
Newbie Poster

Re: Image file upload to thumbnail

 
0
  #6
Sep 9th, 2008
Hi Atli thanks for that i'll take a look and see how i get on
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 5
Reputation: silntj101 is an unknown quantity at this point 
Solved Threads: 0
silntj101's Avatar
silntj101 silntj101 is offline Offline
Newbie Poster

Re: Image file upload to thumbnail

 
0
  #7
Sep 9th, 2008
Nikesh thank you i'll check out what you suggested for option one and langsor thanks for the code. You were right, i dont really understand what it is and which one i can use but i shall study it hard as it looks well commented.
Thank you all for a speedy response. I shall post again later on today if i cannot get my head around it, thanks again.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC