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 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

Member Avatar for langsor

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

Hi Atli thanks for that i'll take a look and see how i get on :)

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.