automatically resize images before storing in SQL database

Last post 06-21-2009 1:47 AM by RMcBride. 4 replies.

Sort Posts:

  • automatically resize images before storing in SQL database

    06-20-2009, 10:14 PM
    • Member
      57 point Member
    • RMcBride
    • Member since 03-28-2009, 3:12 PM
    • Posts 405

    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

  • Re: automatically resize images before storing in SQL database

    06-20-2009, 11:57 PM
    • Contributor
      7,249 point Contributor
    • whighfield
    • Member since 01-02-2006, 10:37 PM
    • Winterpeg, Manitoba
    • Posts 1,205
    Please mark the most helpful reply/replies as "Answer".

    - William
    http://thefrozencoder.ca
  • Re: automatically resize images before storing in SQL database

    06-21-2009, 12:16 AM
    • Member
      57 point Member
    • RMcBride
    • Member since 03-28-2009, 3:12 PM
    • Posts 405

    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

  • Re: automatically resize images before storing in SQL database

    06-21-2009, 12:41 AM
    Answer
    • Contributor
      7,249 point Contributor
    • whighfield
    • Member since 01-02-2006, 10:37 PM
    • Winterpeg, Manitoba
    • Posts 1,205

    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.

    Please mark the most helpful reply/replies as "Answer".

    - William
    http://thefrozencoder.ca
  • Re: automatically resize images before storing in SQL database

    06-21-2009, 1:47 AM
    • Member
      57 point Member
    • RMcBride
    • Member since 03-28-2009, 3:12 PM
    • Posts 405

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

    Richard

Page 1 of 1 (5 items)