locked
Photo Gallery RRS feed

  • Question

  • User895691971 posted

    Hi, is Photo Gallery saving images in Database? Can I change that? As I guess saving the Image in Database won't be a good idea at all.

    Tuesday, July 16, 2013 5:30 AM

Answers

  • User-821857111 posted

    is some database providing 16GB too, is there?

    I don't know, but if you think you are likely to exceed 10GB, you are also likely to exceed 16GB at some point. If you want to keep your hosting costs low, you can either use MySQL (which doesn;t have a limit and is often free - but doesn't work with the WebSecurity provider) or make the code alterations we discussed earlier to save to disk.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 16, 2013 3:38 PM
  • User-821857111 posted

    I save the images to disk and all of the text (articles and comments) are saved in a SQL Server database. At the moment, the database is just under 8MB in size. It has about 200 articles and a couple of thousand comments in it. I have about 450 images, which take up 8MB on disk, so I could save all those in the database and still it will only be 16MB. A long way to go to hit 10GB.....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 16, 2013 4:09 PM

All replies

  • User-821857111 posted

    Yes, they do get saved to the database. You can save to the file system instead, but you will have to modify code in a number of places to do that. 

    Afzaal.Ahmad.Zeeshan

    saving the Image in Database won't be a good idea at all.

    The only issue you might run into is that Sql CE is limited 10GB in size (which is a lot of photos) so if you think you might exceed that, upgrade to SQL Server instead.

    Tuesday, July 16, 2013 7:41 AM
  • User895691971 posted

    Yeah, I know! As there are many places where ASP.NET team has provided a code that's more like I never saw in tutorials of this site! But this code to save the image in database as Binary data will consume alot of space. However will try to change the code.

    The only issue you might run into is that Sql CE is limited 10GB in size (which is a lot of photos) so if you think you might exceed that, upgrade to SQL Server instead.

    Yes, this was the issue that hit my mind at the first place. And you said SQL CE provides 10GB. However in this forum somewhere, I was told it allows only 4Gb and SQL Server allows 8, Can you tell me the real quantity please?

    Second thing, I have tried to do that, (Skipping the download part, download and install of SQL Server) What is that password thing? How to get that set? I really can't understand that part, mostly that windows authentication and the other one! Little elaboration if I could get!

    Tuesday, July 16, 2013 7:52 AM
  • User-821857111 posted

    The only issue you might run into is that Sql CE is limited 10GB in size (which is a lot of photos) so if you think you might exceed that, upgrade to SQL Server instead.

    Yes, this was the issue that hit my mind at the first place. And you said SQL CE provides 10GB. However in this forum somewhere, I was told it allows only 4Gb and SQL Server allows 8, Can you tell me the real quantity please?

    My bad. It's 4GB for Sql CE. SQL Server Express is the one limited to 10GB.

    Tuesday, July 16, 2013 8:18 AM
  • User-821857111 posted

    this code to save the image in database as Binary data will consume alot of space

    It will consume much the same amount of space on disk as in the database.

    Tuesday, July 16, 2013 8:19 AM
  • User895691971 posted

    And there is some database providing 16GB too, is there? I just heard about it.

    Tuesday, July 16, 2013 9:09 AM
  • User895691971 posted

    Yes, but we won't have to create a new file folder instead we will just keep saving file. But for database, we will have to create a new database once the current one is full! Is it right? 

    Tuesday, July 16, 2013 9:11 AM
  • User-821857111 posted

    is some database providing 16GB too, is there?

    I don't know, but if you think you are likely to exceed 10GB, you are also likely to exceed 16GB at some point. If you want to keep your hosting costs low, you can either use MySQL (which doesn;t have a limit and is often free - but doesn't work with the WebSecurity provider) or make the code alterations we discussed earlier to save to disk.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 16, 2013 3:38 PM
  • User895691971 posted

    Yes, I am surely going to make alterations in the code. However you're right when saying that I am going to exceed 16GB. But just wanted that I should get a Database that would last longer then to change the database every month(if it gets filled up). However the images will be saved in File Folers of course. But I am also thinking about saving Text data in JSON files so that Databases get their full potential for the Login Data.

    You have a website too, where do you save? You have long lengthy pages, where is the place for your text information? Comments will surely be in Database, but tutorials? 

    Tuesday, July 16, 2013 3:42 PM
  • User-821857111 posted

    I save the images to disk and all of the text (articles and comments) are saved in a SQL Server database. At the moment, the database is just under 8MB in size. It has about 200 articles and a couple of thousand comments in it. I have about 450 images, which take up 8MB on disk, so I could save all those in the database and still it will only be 16MB. A long way to go to hit 10GB.....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 16, 2013 4:09 PM
  • User895691971 posted

    After reading this reply, I can simply lean back and pay all my attention to code rather than Database.

    Thanks Mike, pretty helping reply, for those who are afraid of Database storage! 

    Tuesday, July 16, 2013 11:25 PM
  • User-1126080808 posted

    Hi,

    Yes, this is not a good idea to save the Images in the database. 

    So, What is the batter option for that? Here is the option.

    Save the image in the file system with some predefine directory structure. 

    Ex. CustomerGallery->CustomerID->ProfileImage

         CustomerGallery->CustomerID->GalleryImage

    Through this way, you can save the images in file system and with unique identification.

    Thankd

    Monday, July 22, 2013 10:43 AM
  • User895691971 posted

    Yes, that I knew! However thanks for reply!

    Tuesday, July 23, 2013 10:44 AM