Hi every one,
bear with me please..
I’m coding a products catalog in DNN4 and would like to provide pdf manuals for the products.
The manuals are stored on the file system in the "Portals" folder
At the moment they are hyperlink with the URL as "~/Portals/0/pdftest.pdf"
But when clicked, of course, the pdfs are opened in the browser automatically which is not what I want.
I want to provide the user with that pop up window requesting the option of either open,save or cancel.
I know this is related to file handling in the System.IO.Stream.
But there is a func the file manager in DNN already uses, so why not make use of it.
I tried calling it using the following:
FileSystemUtils
.DownloadFile("~/Portals/0/pdftest.pdf"
); à nothing happens, just the page refreshs.
FileSystemUtils
.DownloadFile("/Portals/0/pdftest.pdf"
); à nothing happens, just the page refreshs.
FileSystemUtils
.DownloadFile("website/Portals/0/pdftest.pdf"
); ànothing happens, just the page refreshs.
FileSystemUtils
.DownloadFile("
http://127.0.0.1/DotNetNuke Website/portals/0/pdftest.pdf"
); àgot an error "URI formats are not supported.".
I have a feeling that it is something with the the file path,because the func is working ok from the file manager.
If not, does any one have a ready made code for what I want?
Any help is greatly apreciated,
Thank you