+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Images, Documents, and Database Sizes

Images, Documents, and Database Sizes

9 posts, 0 answered
  1. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    06 May 2008
    Link to this post

    I posted a handful of photos via the "Images & Documents" module.  (Very nice, by the way.)  I then noticed the size of my database went from 990 KB (zipped) to 17,941 (zipped).

    This happened because the binary photo data is being stored directly in the database.  I have read a fair amount of debate on whether this is a good practice or not.  I'm not going to open that can of worms though.  I'm neutral on this debate.

    Instead I will merely express that my DiscountASP.net shared hosting platform limits my database disk usage to 300MB.  My regular disk usage limit is around 1 GB.  Which means I'm currently placing my media in the "bucket" with the least room.

    Is there a way to configure Sitefinity to store the physicial media files on the disk?  (Perhaps in ~/_Files?)  The database could then store references to these files.

    This isn't a huge deal yet; but it is a potential future concern.  For a very media rich Sitefinity web site this database habit might get expensive.

    Gabe Sumner
    http://www.goondocks.com/

  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    07 May 2008
    Link to this post
    Hi Gabe Sumner,

    Unfortunately at the moment there is no way just to configure the storage of files. However, we are working on a very flexible solution for this that will be released in the future (no exact date at the moment, though).

    But, we've come up with a battle plan that will allow you to implement this by yourself (will serve as an excellent material for blog post as well :).

    You will need to implement a new Provider for libraries. Now, the good thing is that you can inherit the Default Libraries provider and all that you need to do is implement the OnExecuting event handler.

    Here are the step-by-step instructions:

    1. Add a new meta field to descriptions (e.g. FileUrl). You'll keep the URL of the file here.

    OPTION A:
        2. Implement the new Provider for libraries. Inherit the default libraries provider.
        3. Implement OnExecuting event handler in this new provider.
        4. Check for the command names in ExecutingEventArgs 
            (possibilities "CreateContent", "UpdateContent", "DeleteContent")
        5. If "CreateContent" or "UpdateContent" save the binary value of the Content property as a file 
            somewhere on your disk. (A good idea seems to have one folder, like "storage" or "repository" and 
            save all the files there, where file name can be a guid or something like that). If "DeleteContent" -
            delete the file.
        6. Set the content property to null, so that the binary file does not get saved to database
        7. Create the url of this file (should be as the one specified in your web.config for the url rewriting settings).
        8. Save this url to the metafield you've created in the step 1
    OPTION B:
        Instead of overriding the Provider you can create a new class (e.g. in the App_Code folder) and subscribe to  
        the static OnExecuting event. If you go this way make sure it's the Libraries provider that fired the event.  
        Steps 3 - 8 are same.

    9. Override Telerik.Cms.Engine.ContentHttpHandler. Basically our HttpHandler gets the url finds the record in the database and serves the binary file. Your should get the url, find the record in database, find the url of the file from meta field, read the file into a binary file and serve it out as a binary.

    I hope this make sense. Let us know if you have any additional questions.

    Greetings,
    Ivan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. sam
    sam avatar
    102 posts
    Registered:
    31 Jan 2008
    21 May 2008
    Link to this post
    This too is a huge issue for me. Our church is using third party hosting and the db plan is not that big.. so if they start adding images this is going to break the plan..
  4. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    23 May 2008
    Link to this post
    Hello Sam,

    Currently we do not plan to change the set up for storing the images in the database. This is why we would appreciate if you could take a closer look at the previous post. It contains two different approaches which can be used to work around this method of storing data. My colleague Ivan has included detailed explanations, and following these steps would result in exactly what you are aiming at.

    Hope this helps.

    Sincerely yours,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    23 May 2008
    Link to this post
    Hi,

    Ok, we understand, is not sf. priority. Could someone help-us to make this for all not rich users including external hosting. Any help for completing the steps indicated by Ivan are biggest help. Regards.
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 May 2008
    Link to this post
    Hi Pierre,

    We would like to point out that it is our priority to make you and everyone else feel happy with Sitefinity. It is our priority also to care about our customer needs. Therefore, we are always trying to give some directions and guidances on every issue you have. As we provided the steps, we expected you to try following them. In such cases, when you need different core functionality, we do not provide the entire custom solutions but rather assist you with particular questions/ordinary samples which illustrate some aspect or enhancement over a given functionality of our product.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Jesse
    Jesse avatar
    4 posts
    Registered:
    07 Mar 2008
    08 Apr 2009
    Link to this post
    I too need a solution for this for the "Documents" being stored in SQL Server.. I need them stored on the file system because a 4+GB datafile isn't an option for my environment.
    I think what folks are looking for is very specific (as in you provide the code that we can just copy into the App_code folder or something) examples.

    Saying something like "make a new class that implements the Library provider" doesn't mean a lot for some folks.

    I mean, we could sit here and try to write the code, or you could simply just make the class and post it up so we can then modify it as needed.

    This isn't a gripe... I love the telerik products, but I can say from my own perspective, the "above" is the kind of reason why we as a company choose commercial "supported" software over comparable open-source platforms.
    The argument being, if Im going to dig into the code and try to find out on my own how or why something works, then why not just stay open-source?

  8. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    08 Apr 2009
    Link to this post
    Hi Jesse,

    Let me first tell you that I can completely understand how you feel.

    The Images and Documents module is not the only solution you have. You can always use the file system, right? The decision for making this module to work that way came from a usability research. I agree that we could have a provider that is storing the images on the file system.

    Note that we do not provide an entire custom solutions but rather assist with particular questions/ordinary samples which illustrate some aspect/enhancement over a given functionality of our product. It is the developer’s responsibility to define the schema/specification of the main project relations and process the implementation. You may also contact our partners for paid assistance.

    I will not discuss the open source projects here. As for Sitefinity, it is a developer's sandbox after all.

    As I said, I understand the position you are in. That is why, I will see if we will be able to develop such provider, and post is in our blogs. Still this is kind of exception, because usually we do not provide custom development.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  9. Jesse
    Jesse avatar
    4 posts
    Registered:
    07 Mar 2008
    08 Apr 2009
    Link to this post
    Thanks!  I appreciate the effort..

    Just some clarification on how to actually perform certain steps on that list would be helpful.. I understand the (at least the basics) of the provider model and what it does.   Maybe if there is a generic "Custom Provider" walkthru I can go through or you can point me into the right direction, then that could help.

    I konw for example, another problem I was having.. examples that I read on here and on the web have this assumption that im familiar with the development platform..   I realize htat SiteFinity is a developers toolbox,  I guess I realize that more now as I work with it as opposed to when we were looking at it.

    Cause lets face it..   my requirements started out as "I need to be able to edit some web pages and add some content here and there" and suddently its "I need a full blown document management system!"

    Thanks for the response... keep up the good work!

Register for webinar
9 posts, 0 answered