Closed MRcode2102 closed 3 years ago
the library has special functions to optimize writes to client including writing of a whole file. see the SDWebServer example. there the file is downloaded, but the idea is the same.
client.write([](Print& p) { // anonymous lambda function to be called by the library
p.println(F("HTTP/1.1 200 OK"));
p.println(F("Connection: close"));
p.print(F("Content-Length: "));
p.println(file.size());
p.print(F("Content-Type: "));
const char* ext = strchr(file.name(), '.');
p.println(getContentType(ext));
p.println();
});
client.write(file); // send the file as body of the response
file.close();
Hi Mr Jandrassy Thank you for your response. If possible Can you explain more about this?
For example, in this part of the code
client.write([](Print& p) { // anonymous lambda function to be called by the library
p.println(F("HTTP/1.1 200 OK"));
p.println(F("Connection: close"));
p.print(F("Content-Length: "));
p.println(file.size());
p.print(F("Content-Type: "));
const char* ext = strchr(file.name(), '.');
p.println(getContentType(ext));
p.println();
});
client.write(file); // send the file as body of the response
file.close();
why the buffer is not used? Because I am a beginner. thanks...
client.write(file)
sends the whole file the most efficient way using the internal buffer of the library and optimal transfer over UART and WiFi.
BTW
client.write(file)
sends the whole file the most efficient way using the internal buffer of the library and optimal transfer over UART and WiFi.
Thank you again for your answer Mr Jandrassy. I had another question, sir, do you think I can send a 200 KB file to a server with your library and with Arduino mega 2560 and a esp 12F module which connected together with UART port? Thank you very much again sir for taking the time to answer me
I had another question, sir, do you think I can send a 200 KB file to a server with your library and with Arduino mega 2560 and a esp 12F module which connected together with UART port? Thank you very much again sir for taking the time to answer me
yes. but set 250000 baud on Serial to esp8266 and in AT firmware
Thank you sir for answering my questions Excuse me, is it possible to give me the contact number from WhatsApp or if you have another social network? Because I had a few small questions for your service if there is no problem Thanks
Thank you sir for answering my questions Excuse me, is it possible to give me the contact number from WhatsApp or if you have another social network? Because I had a few small questions for your service if there is no problem Thanks
you can ask here
Now can i ask a question mr?
Hi Mr. JANDRASSY I want to upload a wave file, that is stored in my sd card to a web server with ESP12-F module which connected to Arduino mega 2560 with serial (UART) port, and I using of your library's (WiFiEspAt.h) but my problem is for uploading files with size Biggers than 32k to the webserver (WampServer I using), because I don't have problem with files less than 32kb for uploading I attached my sketch and php code below If you can help me thanks ...
my sketch
the php code