Home > Net >  How to put a file on the server, and then the user input can directly download the address?
How to put a file on the server, and then the user input can directly download the address?

Time:01-20

Such as anyone in the browser input address: http://58.87.203.153/down/123.txt, you can directly download the file, I put the files on the iis virtual directory if it is compressed package can directly download, but always TXT directly in the browser to open, can not download directly, how to do?

CodePudding user response:

Please baidu "MIME header", because we don't know what server you use, so only tell you browser according to "the MIME header", different browser rules, so want to unified download TXT, then put the TXT suffix MIME header modified into "application/octet - stream"

All kinds of web server changes in a different way, if it is a net, can also be in the web. Config to configure suffix and MiME, specific how to match, or please baidu "web. Config MiME"

CodePudding user response:

Label change head?
  • Related