File Download

Discussion in 'ASP .Net' started by ^MisterJingo^, Jul 29, 2006.

  1. Hi all,

    I've written some code which allows a user to browse a directory and
    any subdirectories it contains. The page which contains this can only
    be browsed by users with a certain cookie (the page checks for this
    before allowing access).
    To stop files being downloaded through a link to them on a server
    (potentially allowing unauthorized people access) I've put the
    directory containing the files outside of the web root.
    This all works fine, but i'm unsure how to go about offering the files
    for download to people logged in.
    I know there mgiht be easier ways of doing this, but i've been told
    that there should be no login page, as the users of this file browser
    will be linked to it from different VLEs - so a cookie solution was
    chosen as it will be seemless.
    Any help or advice on how to go about this would be appreciated.
     
    ^MisterJingo^, Jul 29, 2006
    #1
    1. Advertising

  2. Create a page that checks the cookie, reads the requested file, sets the
    MIME type to the file type and streams out the bytes.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************************************************
    Think Outside the Box!
    *************************************************
    "^MisterJingo^" <> wrote in message
    news:...
    > Hi all,
    >
    > I've written some code which allows a user to browse a directory and
    > any subdirectories it contains. The page which contains this can only
    > be browsed by users with a certain cookie (the page checks for this
    > before allowing access).
    > To stop files being downloaded through a link to them on a server
    > (potentially allowing unauthorized people access) I've put the
    > directory containing the files outside of the web root.
    > This all works fine, but i'm unsure how to go about offering the files
    > for download to people logged in.
    > I know there mgiht be easier ways of doing this, but i've been told
    > that there should be no login page, as the users of this file browser
    > will be linked to it from different VLEs - so a cookie solution was
    > chosen as it will be seemless.
    > Any help or advice on how to go about this would be appreciated.
    >
     
    msnews.microsoft.com, Jul 29, 2006
    #2
    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. Ryan Taylor
    Replies:
    2
    Views:
    953
    Ryan Taylor
    Nov 10, 2004
  2. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,625
    Steve C. Orr [MVP, MCSD]
    Mar 7, 2005
  3. Sam --
    Replies:
    2
    Views:
    617
    Sam --
    Mar 17, 2005
  4. Rafal Majda
    Replies:
    5
    Views:
    2,307
    Rafal Majda
    Apr 18, 2005
  5. Brett  Kelly
    Replies:
    1
    Views:
    684
    Steve C. Orr [MVP, MCSD]
    Jun 16, 2006
Loading...

Share This Page