These are chat archives for esp8266/Arduino

3rd
Oct 2015
Lstt2005
@Lstt2005
Oct 03 2015 05:49
Dear friends! Who may implement this libraries (Telegram bot)? - http://www.esp8266.com/viewtopic.php?f=29&t=5789 :smile:
p1337
@p1337
Oct 03 2015 15:56
hello, could someone help me with my esp8266 - http / dns server project ? - i´ve got an SD Server running... how does the HTTP "/edit" fileuploads work ?
is there a tutorial / how you can post file to the esp8266 ?
this is a part of the arduino Code:
void handleFileUpload(){
if(server.uri() != "/edit") return;
HTTPUpload& upload = server.upload();
if(upload.status == UPLOAD_FILE_START){
if(SD.exists((char )upload.filename.c_str())) SD.remove((char )upload.filename.c_str());
uploadFile = SD.open(upload.filename.c_str(), FILE_WRITE);
DBG_OUTPUT_PORT.print("Upload: START, filename: "); DBG_OUTPUT_PORT.println(upload.filename);
} else if(upload.status == UPLOAD_FILE_WRITE){
if(uploadFile) uploadFile.write(upload.buf, upload.currentSize);p
DBG_OUTPUT_PORT.print("Upload: WRITE, Bytes: "); DBG_OUTPUT_PORT.println(upload.currentSize);
} else if(upload.status == UPLOAD_FILE_END){
if(uploadFile) uploadFile.close();
DBG_OUTPUT_PORT.print("Upload: END, Size: "); DBG_OUTPUT_PORT.println(upload.totalSize);
}
}
Me No Dev
@me-no-dev
Oct 03 2015 17:42
you post files to http://ip-of-esp/edit
there are some files in the SD Server sketch folder that usually go on the SD Card
they will give you interface to the file system andlet you edit/upload/download
p1337
@p1337
Oct 03 2015 18:37
thanks for your answer, i´ve tried to post files - to /edit
<form enctype="multipart/form-data" action="/edit" method="POST">
<!-- MAX_FILE_SIZE muss vor dem Dateiupload Input Feld stehen -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Der Name des Input Felds bestimmt den Namen im $_FILES Array -->
Diese Datei hochladen: <input name="upload" type="file" />
<input type="submit" value="Send File" />
</form>
but no files was created
Me No Dev
@me-no-dev
Oct 03 2015 18:46
does anything come up inthe serial?
p1337
@p1337
Oct 03 2015 19:00
i´ll check

seems to be okay : Upload: WRITE, Bytes: 2048
Upload: WRITE, Bytes: 2048
Upload: WRITE, Bytes: 1814
Upload: END, Size: 1144598

<meta http-equiv='refresh' content='0; URL=http://192.168.4.1/'>

this is the beginning : '>LmacRxBlk:1
LmacRxBlk:1
Upload: START, filename: image.jpeg
Upload: WRITE, Bytes: 2048
Upload: WRITE, Bytes: 2048
Me No Dev
@me-no-dev
Oct 03 2015 19:06
yes it seems ok
p1337
@p1337
Oct 03 2015 19:37
have i create the edit folder perhaps ?