Refer to download folder not under www folder

Results 1 to 2 of 2

Thread: Refer to download folder not under www folder

  1. #1
    Join Date
    Dec 1969

    Default Refer to download folder not under www folder

    Let&#039;s say with a web host a client has a www folder with all the "public view" files and folders.<BR><BR>But at the same level as the www folder is a private folder called download to store downloadable files to be streamed. The download folder used to be just below the www folder and the code in the whole project is already written and works that way.<BR><BR>I know I can use the physical address of E:MyHostMyAccountdownload to refer to the physical address of the folder instead of E:MyHostMyAccountwwwdownload. But right now the physical address in various parts of the project derive the physical address from the virtual address of the folder (and it would be nice not to have to change the code in those various places).<BR><BR>So is there a way I can refer to this folder&#039;s virtual address?<BR><BR>This is because the code is already written for the project using the following variable in an included page called something like config.asp:<BR>DownloadFolder = "/download"<BR><BR>And elsewhere in the program the following is used:<BR>Server.MapPath(DownloadFolder)<BR><BR>Thi s worked fine when the download folder was just below the www folder. But now the client wants the download folder to be at the same level as the www folder.<BR><BR>So how can I change the config.asp file&#039;s DownloadFolder variable? Seems like it might be something like this:<BR>DownloadFolder = "/../download"<BR><BR>Or perhaps this:<BR>DownloadFolder = "/../../download"<BR><BR>But it doesn&#039;t seem to work. No matter how many ..&#039;s I put in, Server.MapPath(DownloadFolder) never seems to be able to get above the www...<BR><BR>Any ideas?<BR><BR>Thanks,<BR>-Paul<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Refer to download folder not under www folder

    "never seems to be able to get above the www..."<BR>and it never will. according to the webserver, this application&#039;s root folder is the www folder. You will either need to make a virtual path to the folder you want on the server itself (might be difficult if you don&#039;t have direct access to it), or change your code from relative paths to absolute (../folder to c:wwwdocsclientdocs"<BR><BR>no other way around it, that I know of (it&#039;s a security issue)<BR><BR>~~Chaotix<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