Monday, November 19, 2007

How to make a file download link in Dynamic Web

Sometimes you want the user to be able to just download a file you point to from your Dynamic Web CMS homepage. What you need to do is simple:
  • Prefix your filepath with:
    /Admin/Public/DWSDownload.aspx?File=

  • If your file is here:
    /Files/files/myFile.txt

  • Resulting URL:
    /Admin/Public/DWSDownload.aspx?File=/Files/files/myFile.txt

If the file path is written using Javascript you should
escape()
the file path.

No comments: