Skip to content

MultipartParseError: Did not find boundary character 48 at index 2 when uploading large files #452

Answered by tarsil
prashikdewtale10 asked this question in Q&A
Discussion options

You must be logged in to vote

@prashikdewtale10 I literally added a test proving that passes with more than 1MB, maybe something its not right on your side? Let me share an example with you:

import httpx

from io import BytesIO
from pathlib import Path
from typing import Any, Dict

from esmerald import Esmerald, Form, Gateway, Request, post

def create_dummy_file(size_in_bytes: int, filename: str = "test.txt"):
    file_buffer = BytesIO()
    file_buffer.write(b"0" * size_in_bytes)
    file_buffer.name = filename
    file_buffer.seek(0)
    return file_buffer


@post("/upload-data/")
async def create_upload_file(request: Request, data: Any = Form()) -> Dict[str, Any]:
        return {
            "filename": data.get("…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@prashikdewtale10
Comment options

@tarsil
Comment options

@prashikdewtale10
Comment options

@tarsil
Comment options

Answer selected by prashikdewtale10
@prashikdewtale10
Comment options

@tarsil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants