Developer forum

Forum » Development » Force download of file

Force download of file


Reply

Hi


 


My module needs to force download of certain files (PDF's). Is there any standard functionality that would allow this? I can see the file /Admin/Public/Download.aspx is used in the file archive. Feeding it with the following parameters cause it to just hang without anything happening:


 


/Admin/Public/Download.aspx?File=Admin/Public/Module/MyModule/Download.pdf&LocationType=x


 


Without the LocationType it's not able to find the file at all.


 


I could of course use a frontend module that sends the file and Response.Ends to stop the further rendering of the page, but that would probably cause a hit in the statistics which I would like to avoid.


 


Thanks,


Mark


Replies

 
Angel
Reply


Hi Mark







You can do like this:




Admin/Public/DWSDownload.aspx?File=Files%2fFiler%2fModules%2fDanish%2fCMS%2fFact_Sheet_Web%2fDynamicweb_Afstemning.pdf







ipaper@webmentor.dk wrote:








Hi




My module needs to force download of certain files (PDF's). Is there any standard functionality that would allow this? I can see the file /Admin/Public/Download.aspx is used in the file archive. Feeding it with the following parameters cause it to just hang without anything happening:




/Admin/Public/Download.aspx?File=Admin/Public/Module/MyModule/Download.pdf&LocationType=x


Without the LocationType it's not able to find the file at all.


I could of course use a frontend module that sends the file and Response.Ends to stop the further rendering of the page, but that would probably cause a hit in the statistics which I would like to avoid.




Thanks,


 


Mark





 

You must be logged in to post in the forum