File download file name specified is invalid

Our environment is Boa+CGI/C, download the code as follows:
printf("Content-Type: application/octet-stream\n");
printf("Content-Disposition: filename=sysLog\r\n");
printf("Content-Disposition: attachment\r\n\r\n");
Downloadable content is no problem, but the file name is CGI, I am not the specified file name. I have the mime.types file in the /etc directory, or invalid, hope someone pointing, thanks in advance!

Started by Cash at November 21, 2016 - 3:51 PM

printf("Content-Type: application/octet-stream\n");

This is it right? There is a problem, there should be two carriage return.:)
printf("Content-Type: application/octet-stream\n\n");

Posted by Ian at November 29, 2016 - 4:20 PM

Do you is how to realize the file download?
Thank you

Posted by Doris at November 30, 2016 - 5:19 PM

printf("Content-Disposition: attachment;filename=test.zip\n\n");
So that you can,
The printf ("Content-Type: application/octet-stream\n"); can be deleted.
I also for this depressed for several hours.
Open a webpage, the browser will first look at whether there is a Content-Disposition: attachment that, if there is, no matter what is the value of Content-Type, will prompt file download.
When you specify Content-Type under certain conditions makes filename is invalid.

Posted by Liz at December 02, 2016 - 5:41 PM

Is good advice is worth learning!

Posted by Darcy at December 11, 2016 - 6:03 PM

Excuse me, I have not solved the problem, I also had a similar problem.
Inline filename do not take.

Posted by Pamela at December 20, 2016 - 6:58 PM