Implementation of multipart/form-data parsing and file upload handling. More...
#include "framework_config.h"
#include "DebugTrace.h"
#include "http/MultipartParser.h"
#include <lwip/sockets.h>
#include <iostream>
#include <cstring>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <cctype>
#include <FreeRTOS.h>
#include <task.h>
#include "framework/AppContext.h"
#include "storage/StorageManager.h"
Go to the source code of this file.
Part of the PicoFramework HTTP server. This module processes multipart/form-data uploads, detects boundaries, parses headers, extracts filenames, and writes file data to storage. It also handles sending appropriate HTTP responses based on the success or failure of the upload process.
Extracts the boundary from the Content-Type header Manages multipart state using a basic state machine (SEARCHING_FOR_BOUNDARY, FOUND_BOUNDARY, etc.) Used a streaming recv() loop Bufferes data and handles chunk boundaries Writes file data incrementally (appends to file to cope with large file sizes) Rejects uploads with duplicate filenames Only supports one file per request (for simplicity)
Definition in file MultipartParser.cpp.