fix(zip): stream ZIP to temp file instead of loading entire archive into RAM

Solution C - Hybrid temp-file streaming:
- ZipPort trait now returns NamedTempFile instead of Vec<u8>
- ZipService writes to a temp file via ZipWriter<std::fs::File> (O(1) RAM)
- Files are read in 64KB stream chunks via get_file_stream() instead of get_file_content()
- HTTP response streams the temp file via ReaderStream (never loads full ZIP in memory)
- Temp file auto-deleted on drop after response completes
- Removed dead imports (HeaderName, HeaderValue, Cursor, Read)
This commit is contained in:
Diocrafts
2026-02-22 22:29:07 +01:00
parent 2dd3dc0b54
commit 5b4cd30e2b
4 changed files with 113 additions and 93 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ impl ZipPort for StubZipPort {
&self,
_folder_id: &str,
_folder_name: &str,
) -> Result<Vec<u8>, DomainError> {
) -> Result<tempfile::NamedTempFile, DomainError> {
Err(DomainError::internal_error(
"ZipService",
"ZipService not initialized",