Skip to content

Error processing request.stream() object #1745

Answered by adriangb
sciai-ai asked this question in Q&A
Discussion options

You must be logged in to vote

A couple issues I'm seeing at first glance

You're receiving multipart data

When you receive data from the client it's always a stream of bytes (think of it like a list/array where each element is a character, except binary so it's really just a number, hence the hexadecimal numbers you're seeing in your stream).

But in this case it is a multipart/form-data request. This is special encoding that allows multiple files to be sent in a single list. The basic idea is to insert a delimiter in between the files, which in your case is the --------------------------e4462b3dae0007d5 at the beginning of the file. It looks like your actual file is the form field called file. You can extract it like t…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sciai-ai
Comment options

@adriangb
Comment options

@sciai-ai
Comment options

Answer selected by Kludex
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
Converted from issue

This discussion was converted from issue #1744 on July 09, 2022 05:46.