Using the FSO to download a file behind the web ro

Results 1 to 3 of 3

Thread: Using the FSO to download a file behind the web ro

  1. #1
    Join Date
    Dec 1969

    Default Using the FSO to download a file behind the web ro

    I have a system where we need to allow users the ability to download files. However, the files are specific to the users themselves so we do not wish to keep them all in a web-viewable directory where other people on the site may potentially go directly to the files and download other people's information. I was wondering if it would be possible to use the FileSystemObject to somehow direct a user to a directory *behind* the web root where we are storing the files so that I can ensure that only the proper users can gain access to their files. Any and all help is appreciated, or I can be emailed at with any questions. Thanks a lot everyone

  2. #2
    Join Date
    Dec 1969

    Default You can't.

    Copy the files to a temp directory that is web-accessible.<BR><BR>Leave the file there for about 4 hours and then delete the file.<BR><BR>Otherwise, you could us the Stream Object or SA&#039;s FileUp object to read the file and stream it to the browser. That would be better, but more work.<BR><BR>-Doug

  3. #3
    Join Date
    Dec 1969

    Default Welll...sort of...

    Doug alluded to a possible solution. And it isn&#039;t all *that* hard.<BR><BR>Basically, you put up a web page customized for a given user and it contains &#060;A HREF=...&#062; links on it. The links might look something like this:<BR><BR>&#060;A HREF="download.asp?file=Ezzlegorf.pdf"&#062;<BR><B R>Then your download.asp page checks to be sure the user is legit (using Session variables, preferably) and, if so, indeed streams the file to the user.<BR><BR>This isn&#039;t my bailiwick, but I&#039;ve seen it done hundreds of times. I think maybe Atrax has something on his site that demos it?<BR><BR>You&#039;re taking a little performance hit, because all the data has to be routed via ASP and FSO instead of being directly downloadable, but that hit is likely worth it for the security you gain.<BR><BR>SO...Yeah, I think you can do it.<BR><BR>

Posting Permissions

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