Presenting MOV-files and images from a DB

Discussion in 'ASP .Net' started by K Viltersten, Apr 27, 2008.

  1. K Viltersten

    K Viltersten Guest

    I'd like to build up a HTML-document using
    a database BUT the tricky part is that one
    of the elements is a MOV-file. The other
    three, four are GIF-files.

    Is such data storable in a database at
    all? Or would it be more suitable to
    create dynamic anchors to a directory
    where all the MOV's and GIF's are put?

    I'm imaging that when a request like:
    http://localhost/fileID_A3DF.aspx
    is issued, the document created will be
    something like:

    <other stuff>
    <img src="A3DF.gif>
    <embed src = "A3DF.mov" height = 135
    width = 155></embed>
    <other stuff>

    I'm assuming that a part of the file name,
    namely "fileID_A3DF.aspx", can easily be
    extracted and its four last characters
    used as an in-parameter, i.e. "A3DF" in a
    call to a database.

    Please comment if you can suggest any
    improvements to that approach.

    --
    Regards
    Konrad Viltersten
    --------------------------------
    sleep - a substitute for coffee for the poor
    ambition - lack of sense to be lazy
     
    K Viltersten, Apr 27, 2008
    #1
    1. Advertising

  2. If you feel you must store the object in the database, you can set up a http
    handler which will stream the data back to the HTML page, this is fairly
    easy to do.



    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "K Viltersten" <> wrote in message
    > news:...
    >
    >> I'd like to build up a HTML-document using a database BUT the tricky part
    >> is that one
    >> of the elements is a MOV-file. The other three, four are GIF-files.

    >
    > OK.
    >
    >> Is such data storable in a database at all?

    >
    > Yes,
    >
    >> Or would it be more suitable to create dynamic anchors to a directory
    >> where all the MOV's and GIF's are put?

    >
    > "Suitable" is perhaps the wrong adjective... There are arguments both for
    > and against storing binary files in databases. I tend to avoid doing it,
    > but that's just a personal preference...
    >
    >> I'm assuming that a part of the file name,
    >> namely "fileID_A3DF.aspx", can easily be
    >> extracted and its four last characters used as an in-parameter, i.e.
    >> "A3DF" in a
    >> call to a database.

    >
    > http://msdn2.microsoft.com/en-us/library/system.io.path.getfilenamewithoutextension.aspx
    > http://msdn2.microsoft.com/en-us/library/system.string.substring.aspx
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    OHM \( One Handed Man \), Apr 27, 2008
    #2
    1. Advertising

  3. You might want to look at the VirtualPathProvider class and concept. This
    allows you to serve an ASP.NET web site from a database, or even from a ZIP
    file.

    -- Peter
    To be a success, arm yourself with the tools you need and learn how to use
    them.

    Site: http://www.eggheadcafe.com
    http://petesbloggerama.blogspot.com
    http://ittyurl.net


    "K Viltersten" wrote:

    > I'd like to build up a HTML-document using
    > a database BUT the tricky part is that one
    > of the elements is a MOV-file. The other
    > three, four are GIF-files.
    >
    > Is such data storable in a database at
    > all? Or would it be more suitable to
    > create dynamic anchors to a directory
    > where all the MOV's and GIF's are put?
    >
    > I'm imaging that when a request like:
    > http://localhost/fileID_A3DF.aspx
    > is issued, the document created will be
    > something like:
    >
    > <other stuff>
    > <img src="A3DF.gif>
    > <embed src = "A3DF.mov" height = 135
    > width = 155></embed>
    > <other stuff>
    >
    > I'm assuming that a part of the file name,
    > namely "fileID_A3DF.aspx", can easily be
    > extracted and its four last characters
    > used as an in-parameter, i.e. "A3DF" in a
    > call to a database.
    >
    > Please comment if you can suggest any
    > improvements to that approach.
    >
    > --
    > Regards
    > Konrad Viltersten
    > --------------------------------
    > sleep - a substitute for coffee for the poor
    > ambition - lack of sense to be lazy
    >
    >
     
    Peter Bromberg [C# MVP], Apr 28, 2008
    #3
  4. K Viltersten

    K Viltersten Guest

    SV: Presenting MOV-files and images from a DB

    > You might want to look at the VirtualPathProvider class and
    > concept. This allows you to serve an ASP.NET web site
    > from a database, or even from a ZIP file.


    Thanks for the help. I'd like to get a clarification on a part of
    it, though. Which of the following two approaches would be
    more suitable, would you say?

    1. To distract the key for DB from the file name.
    http://localhost/fileID_A3DF.aspx

    or

    2. To get the key as an explicit argument.
    http://localhost/fileID.aspx?key=A3DF

    Please advise.

    --
    Regards
    Konrad Viltersten
    --------------------------------
    sleep - a substitute for coffee for the poor
    ambition - lack of sense to be lazy
     
    K Viltersten, Apr 28, 2008
    #4
  5. On Apr 28, 6:38 am, "K Viltersten" <> wrote:
    > > You might want to look at the VirtualPathProvider class and
    > > concept. This allows you to serve an ASP.NET web site
    > > from a database, or even from a ZIP file.

    >
    > Thanks for the help. I'd like to get a clarification on a part of
    > it, though. Which of the following two approaches would be
    > more suitable, would you say?
    >
    > 1. To distract the key for DB from the file name.
    >    http://localhost/fileID_A3DF.aspx


    Here you would need to implement an URL rewriting technique
    http://www.google.com/search?hl=en&q=asp.net URL rewrite

    >
    > 2. To get the key as an explicit argument.
    >    http://localhost/fileID.aspx?key=A3DF
    >


    This will work by default.
     
    Alexey Smirnov, Apr 28, 2008
    #5
  6. K Viltersten

    K Viltersten Guest

    SV: Presenting MOV-files and images from a DB

    >> Thanks for the help. I'd like to get a
    >> clarification on a part of it, though.
    >> Which of the following two approaches
    >> would be more suitable, would you say?
    >>
    >> 1. To distract the key for DB from the file name.
    >> http://localhost/fileID_A3DF.aspx

    >
    > Here you would need to implement an URL rewriting technique
    > http://www.google.com/search?hl=en&q=asp.net URL rewrite
    >
    >> 2. To get the key as an explicit argument.
    >> http://localhost/fileID.aspx?key=A3DF

    >
    > This will work by default.


    In that case, this'll be the method i'll
    use. Why complicate thing? Thanks!

    --
    Regards
    Konrad Viltersten
    --------------------------------
    sleep - a substitute for coffee for the poor
    ambition - lack of sense to be lazy
     
    K Viltersten, Apr 28, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rosmi
    Replies:
    1
    Views:
    1,062
    Michael Meyer
    Nov 13, 2003
  2. long eddy

    =test please= >.mov files<

    long eddy, Jan 5, 2006, in forum: HTML
    Replies:
    2
    Views:
    530
    cwdjrxyz
    Jan 6, 2006
  3. siggi

    python and MOV or MPEG

    siggi, Jan 15, 2007, in forum: Python
    Replies:
    4
    Views:
    319
    siggi
    Jan 15, 2007
  4. Andrew Arrow
    Replies:
    3
    Views:
    116
    Tim Hunter
    Sep 7, 2008
  5. Iain Lea
    Replies:
    0
    Views:
    119
    Iain Lea
    Apr 14, 2005
Loading...

Share This Page