This is a migrated thread and some comments may be shown as answers.

Resize Photo and Save to DB

1 Answer 80 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 04 Sep 2009, 11:07 PM

I'm working on a project where i need to upload images to a DB. The images could vary in size when being uploaded by the clients, but when inserted in the DB, they cannot be larger than 640x480. I went through the examples in the documentations, they all reference saving the images to the file system. I'm having a hard time doing the conversion to a bitmap, then to a GraphicImage, then back to a byte stream to insert in the DB. Loading the original UploadedFile into the DB is not an issue at all:

Dim FileBytes(PhotoFile.InputStream.Length - 1) As Byte

 

 

 

PhotoFile.InputStream.Read(FileBytes, 0, PhotoFile.InputStream.Length)

Any help would be appreciated,
-Sam

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 07 Sep 2009, 07:48 AM
Hello Sam,

I have attached a sample project that shows how to resize images and save them to a database. I hope it will help you to get started.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Upload (Obsolete)
Asked by
Sam
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or