javascript - Node.js webserver; Show contents of pgp asc file, not prompt for download -


If you click on this link:

Your browser instead of displaying the content of the file Attempts to download APIs and those sites which need to read it

Mime type, right? Any idea how to tell my node server to do this?

You have to set the content - type Type "headers, your browser will display it instead of downloading the file.

  with curl --head http: http: //kencode.de/kenCode.asc  

I think Content types: Applications / pgp-signature

Browsers offer to save the application file types, but < Code> text / plain Show file type Here's why "text / plain" is appropriate for this and why the character set is required. From

, it looks like this:

  response.setHeader ("content type", "text / plain; charset = UTF-8");  

If you can not modify the response directly in the file, then you have to configure your web server to do this. Web servers often mapped file types based on their extensions when not specifically provided by web applications. For example, if you are using Apache server, you can add it to the .htaccess file to fix it:

  AddType text / plain; Charset = UTF-8 .asc  

Comments