To answer both your questions.
The csv is created in real-time.
I know the exact size before-hand, since i know how many values and the length of every value.
The 1000 here above was just an example.
I'll check with the fine folks at snippets-r-us. Thanx for the tip.
I know the exact size before-hand, since i know how many values and the length of every value.
The 1000 here above was just an example.
Using the actual value in the example would have made more sense. You said that that collection of statements was stuff that didn't work, without defining what they actually accomplished, and how that differed from what you expected. So, we can only surmise that your expectations are wrong, or that the order of the statements actually used was incorrect.
I'll check with the fine folks at snippets-r-us. Thanx for the tip.
This won't work. It sends a blank line, indicating end of header.
Serial.println("HTTP/1.1 200 OK\r\n");
Remove the "\r\n" from it.
I did not check the rest of it because you didn't include it in your post. That was what PaulS was saying.
"If the OP thinks it isn't important enough to post, it probably is".
Actually, the code i posted was all i had at the time. The result was that nothing happened.
My expectations were a downloaded CSV-file. Obviously.
So i gave all the info i had at the time. I also decided to include the code i had at that time, in order to show what i've tried.
If i hadn't post a example code, you guys would've moaned about the absence of an example, etc etc.
SurferTim was right though, double break lines doesn't seem to work. However, this was not the only problem.
Now, i got it to work, almost.
an update:
After some testing, i almost got this working:
an update:
After some testing, i almost got this working:
HTTP/1.1 200 OK
Content-Description: File Transfer"
Content-Type: application/force-download
Content-Type: application/CSV
content-disposition attachment;filename="myfile.csv"
Pragma: public
Pragma: no-cache
Content-Length: 20
\r\n
1;2;3;4;5;6;7:8;9;0;\r\n"
The browser starts to download a file, however, the filename is not "myfile.csv". The filename comes from my "querystring".
For example: http://192.168.111.1/xyz
HTTP-request : GET /xyz/HTTP/1.1
the downloaded file is called xyz (without extension).
Any ideas why the "content-disposition attachment;filename="myfile.csv" is not working?
SurferTim:
This won't work. It sends a blank line, indicating end of header.
Serial.println("HTTP/1.1 200 OK\r\n");
Remove the "\r\n" from it.
I did not check the rest of it because you didn't include it in your post. That was what PaulS was saying.
"If the OP thinks it isn't important enough to post, it probably is".
This was not the problem.
I have the double enofLines in my code now, and it works just fine.
After the content-length however, there must be empty row.
SurferTim:
This won't work. It sends a blank line, indicating end of header.
Serial.println("HTTP/1.1 200 OK\r\n");
Remove the "\r\n" from it.
I did not check the rest of it because you didn't include it in your post. That was what PaulS was saying.
"If the OP thinks it isn't important enough to post, it probably is".
This was not the problem.
I have the double enofLines in my code now, and it works just fine.
After the content-length however, there must be empty row.
SurferTim:
This won't work. It sends a blank line, indicating end of header.
Serial.println("HTTP/1.1 200 OK\r\n");
Remove the "\r\n" from it.
I did not check the rest of it because you didn't include it in your post. That was what PaulS was saying.
"If the OP thinks it isn't important enough to post, it probably is".
This was not the problem.
I have the double enofLines in my code now, and it works just fine.
After the content-length however, there must be empty row.
Yes it was, just not the only one.
Well, strange, considering it works for me right now, with that line intact...
Be sure to close the client connection after writing your last byte, since this is the only way the other end will have to know the response body is finished.