Secure Downloads in Shared hosting

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Secure Downloads in Shared hosting

    Hi there, I have created a download website for members, all downloads are held in a folder and a user can access a specific download when he has paid for them, i then write a record into the database to say the user is entitled to download this item. I then wish when the user logs on, to display all downloads they have bought in a web page, via say a link to the download, how would I do this and stop people just typing in the name of the file directly into the address bar as they could then download the file for free. The site is on a shared server so I cannot change the IIS settings

    Any help would be much appreciated as I am scratching my head and typing at the same time in puzzlement of how to accomplish this effectively!!

    dave
    Dave Lambert Guest

  2. Similar Questions and Discussions

    1. Flash com server on shared hosting?
      hey there I am completely new to flashcom server. I have been talking to the flashcom customer service over the phone, who by the way were...
    2. ASP.Net in a shared hosting environment
      Hi, Does anyone know of any concise documents that detail securing the .net framework installation in a shared web hosting environment? ...
    3. Security issues with Asp.Net in Shared Hosting Environments
      Dear Asp.Net Security Community Over the last couple of months I have posted several items in the official Asp.Net website (www.asp.net) related...
    4. ASP.Net shared hosting & security
      Hello. I'm trying to setup a Win2003 server for hosting ASP.Net Applications in a Shared Hosting enviroment. With the "old" ASP I created a...
    5. Question about shared hosting.
      if your server win2k, then the same asp.net process is hosting all the web sites, so all sites share the same max memory. also cross site security...
  3. #2

    Default Re: Secure Downloads in Shared hosting

    Dave,

    Here's the approach I took to a similar situation:

    - I had the downloads in a folder not accessible to anonymous users (can you
    modify permissions?)
    - I processed the download requests programmatically (the code decided
    whether or not they got the download)

    The name of the file could be sent as part of the GET request (ie.
    Download.aspx?file=filename.aaa), then the code could check the database to
    see if they're clear for access.

    Here are some C# code snippits that might help~

    String filename = Request.Params["file"]; // stores "filename.aaa" in
    filename

    // Add your own code here to approve the file.
    // If it's a public site, you probably want to make sure filename doesn't
    // contain double periods, slashes, and whatnot. In fact, you might want
    // to add an encryption/decryption routine just so people will have a
    // hard time generating their own requests

    // If approved for download then do this code
    Response.AppendHeader("Content-Disposition", "attachment; filename=" +
    filename);
    Response.Flush();
    Response.WriteFile("c:\\somefolder\\" + filename);
    Response.End();


    Hope this helps.

    --
    Regards,
    Wes Henderson

    In order to help everyone, please direct all replies to this newsgroup.
    This posting is my personal effort to provide help and is not on behalf of
    any company.
    Also, this posting is provided "AS IS" with no expressed or implied
    warranties.

    "Dave Lambert" <anonymous@discussions.microsoft.com> wrote in message
    news:21BA2AE0-C737-495E-B599-3E600E3B9177@microsoft.com...
    > Hi there, I have created a download website for members, all downloads are
    held in a folder and a user can access a specific download when he has paid
    for them, i then write a record into the database to say the user is
    entitled to download this item. I then wish when the user logs on, to
    display all downloads they have bought in a web page, via say a link to the
    download, how would I do this and stop people just typing in the name of the
    file directly into the address bar as they could then download the file for
    free. The site is on a shared server so I cannot change the IIS settings.
    >
    > Any help would be much appreciated as I am scratching my head and typing
    at the same time in puzzlement of how to accomplish this effectively!!!
    >
    > dave

    Wes Henderson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139