How can I force a download of a pdf in a url?

后端 未结 2 2097
[愿得一人]
[愿得一人] 2020-12-17 22:51

I have a URL that goes to a pdf file. In my coldfusion page, I want to allow the user to download the file (using the open/save dialog or however that particular browser han

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 23:50

    file attribute: Do not specify the path to the directory in this attribute; use the path attribute.

    Try separating the file name and path:

    
    
    
    
    
    

    For smaller files you might skip the temp file and use

    
    
    
    
    

    Update: Dynamic example using a temp file

    
    
    
    
    
    
    
    
    

提交回复
热议问题