By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,898 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,898 IT Pros & Developers. It's quick & easy.

upload image - resize then save

P: n/a
Hi,
Could someone please point to to a tutorial / code for dynamically resizing
images on upload, THEN saving to disk on the webserver.
I need users to be able to upload images to my server, but they will not be
aware of optimising graphics for the web, if someone uploads a 300k 640x480
jpeg for example, i need to be able to shrink it down to a - say 400x300 65k
file BEFORE saving to my webserver.
I have been looking on the web and have found plenty of code for resizing
images and dynamically outputting an optimised images from heavy images that
reside on the server, but i need to shirnk it after getting it from the user
as an input stream before saving it to disk to save disk space.

in summary:
user uploads 600k jpeg via file field in web form
code then shrinks this down (may shrink physically or reduce quality or
both)
saves to disk a 65 k jpeg to disk on the webserver.

(note that i'm not interested in the GetThumbNailImage method for jpegs as
this produces too small an image)

I'm sure there is a tutorial out there for this, or if someone has code to
post here to this that would be fantastic

Thanks for any help.

Tim..
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You may be able to use the GetThumbnailImage method of the Image object.
Here's more info:
http://msdn.microsoft.com/library/de...ImageTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Tim T" <br*********@hotmail.com> wrote in message
news:bo***********@news.wplus.net...
Hi,
Could someone please point to to a tutorial / code for dynamically resizing images on upload, THEN saving to disk on the webserver.
I need users to be able to upload images to my server, but they will not be aware of optimising graphics for the web, if someone uploads a 300k 640x480 jpeg for example, i need to be able to shrink it down to a - say 400x300 65k file BEFORE saving to my webserver.
I have been looking on the web and have found plenty of code for resizing
images and dynamically outputting an optimised images from heavy images that reside on the server, but i need to shirnk it after getting it from the user as an input stream before saving it to disk to save disk space.

in summary:
user uploads 600k jpeg via file field in web form
code then shrinks this down (may shrink physically or reduce quality or
both)
saves to disk a 65 k jpeg to disk on the webserver.

(note that i'm not interested in the GetThumbNailImage method for jpegs as
this produces too small an image)

I'm sure there is a tutorial out there for this, or if someone has code to
post here to this that would be fantastic

Thanks for any help.

Tim..

Nov 17 '05 #2

P: n/a
Thanks for your reply, but that doesn't really help... The thumbnails are
too small.
I have done a workaround where i am saving the uploaded image to disk first,
then resizing it and saving a smaller/optimised version.
still interested if anyone has seen a tutorial to do this in one step, or if
someone has code can they post it or email me
Thanks

Tim

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uf**************@TK2MSFTNGP10.phx.gbl...
You may be able to use the GetThumbnailImage method of the Image object.
Here's more info:
http://msdn.microsoft.com/library/de...ImageTopic.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Tim T" <br*********@hotmail.com> wrote in message
news:bo***********@news.wplus.net...
Hi,
Could someone please point to to a tutorial / code for dynamically

resizing
images on upload, THEN saving to disk on the webserver.
I need users to be able to upload images to my server, but they will not

be
aware of optimising graphics for the web, if someone uploads a 300k

640x480
jpeg for example, i need to be able to shrink it down to a - say 400x300

65k
file BEFORE saving to my webserver.
I have been looking on the web and have found plenty of code for resizing images and dynamically outputting an optimised images from heavy images

that
reside on the server, but i need to shirnk it after getting it from the

user
as an input stream before saving it to disk to save disk space.

in summary:
user uploads 600k jpeg via file field in web form
code then shrinks this down (may shrink physically or reduce quality or
both)
saves to disk a 65 k jpeg to disk on the webserver.

(note that i'm not interested in the GetThumbNailImage method for jpegs as this produces too small an image)

I'm sure there is a tutorial out there for this, or if someone has code to post here to this that would be fantastic

Thanks for any help.

Tim..


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.