locked
automatically resize images before storing in SQL database RRS feed

  • Question

  • User-754876135 posted

    Hi all

    I have a page where users can upload photos associated with their records in our database. The photos are stored in a SQL database as an image. Some of these photos are larger than they need to be for display on a web page. Is there a way in ASP to automatically resize these images before they are uploaded in the database?

    Thanks

    Richard

    Saturday, June 20, 2009 10:14 PM

Answers

All replies

  • User1052258516 posted

    http://www.thefrozencoder.ca/post.aspx?id=31972bad-f517-4516-a820-06b9c59196f5 some code I got off the internet that does this

    Saturday, June 20, 2009 11:57 PM
  • User-754876135 posted

    Hi whigfield

    Alas I am storing the images in a SQL database and your article says "Images must be stored in a folder called “Images”. On the other hand, I could create a serverside version of the file, resize the file and then try to figure out how to get the serverside resized file into the database.

    I would appreciate more ideas if anyone has any.

    Thanks

    Richard

    Sunday, June 21, 2009 12:16 AM
  • User1052258516 posted

    The image in the atricle is resized before it is saved to the folder so instead of saving to the folder you would save the image byte array to the database.

    http://www.thefrozencoder.ca/post.aspx?id=35c6dbaf-a289-4ce5-822b-1e6e45cb68d7 this article shows you how to do that as well.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 21, 2009 12:41 AM
  • User-754876135 posted

    Got it. I can see the solution. I just have to figure out how to implement it in my situation. Thanks

    Richard

    Sunday, June 21, 2009 1:47 AM