Update espmega_iot_core.cpp
This commit is contained in:
		
							parent
							
								
									e2bf2610b3
								
							
						
					
					
						commit
						4c54da6e34
					
				
					 1 changed files with 4 additions and 7 deletions
				
			
		|  | @ -545,16 +545,13 @@ void ota_begin() | |||
|   otaserver.on("/lcd_update",HTTP_POST,[]() { | ||||
|     otaserver.sendHeader("Connection","close"); | ||||
|   },[](){ | ||||
|     for(int i=0;i<otaserver.headers();i++) { | ||||
|         // Print all headers
 | ||||
|         Serial.printf("HEADER[%s]:[%s]\n", otaserver.headerName(i).c_str(), otaserver.header(i).c_str()); | ||||
|     } | ||||
|     HTTPUpload &upload = otaserver.upload(); | ||||
|     size_t file_size = 0; | ||||
|     if(upload.status == UPLOAD_FILE_START) { | ||||
|       for(int i=0;i<otaserver.headers();i++) { | ||||
|         if(!otaserver.headerName(i).compareTo("Content-Length")) { | ||||
|           Serial.printf("Content-Length: %s\n",otaserver.header(i).c_str()); | ||||
|           file_size = otaserver.header(i).toInt(); | ||||
|         } | ||||
|       } | ||||
|        | ||||
|       Serial.println(file_size); | ||||
|       lcd_upload_start(file_size); | ||||
|     } else if (upload.status == UPLOAD_FILE_WRITE) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue