Skip to content

HTTP file upload to SPIFFS #65

Description

@davidchatting-bot

From the README's Development section - filing as a tracked issue.

Current state

onYoYoRequestUPLOAD() and the multipart/form-data branch of onYoYoRequestPOST() (src/YoYoWiFiManager.cpp) both just acknowledge the request with a 200 and do nothing else - no file is actually written to SPIFFS/SD:

else if(request -> contentType().equals("multipart/form-data")) {
  //FILE UPLOAD
  request->send(200);
  result = 200;
}
int YoYoWiFiManager::onYoYoRequestUPLOAD(uint8_t *data, size_t len, AsyncWebServerRequest *request) {
  int result = 500;

  if (request->url().equals("/yoyo/upload")) {
    request->send(200);
    result = 200;
  }
  ...

So today there's no way to push new HTML/JS/media assets to a device over the network - the data folder has to be uploaded via the Arduino IDE's SPIFFS/SD uploader tool over USB.

Ask

Wire up onYoYoRequestUPLOAD() (AsyncWebServerRequest's multipart body-parsing callback gives you data/len/index/total per chunk) to actually stream the incoming file to the current fs (SPIFFS or SD, per storageType), so data folder assets can be updated over WiFi without a USB reflash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions