Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProcessMultipartBody adds tail of header in file #14

Open
jkearins opened this issue Oct 7, 2017 · 6 comments
Open

ProcessMultipartBody adds tail of header in file #14

jkearins opened this issue Oct 7, 2017 · 6 comments

Comments

@jkearins
Copy link

jkearins commented Oct 7, 2017

Hi, when I try to upload my own binary file, the uploaded file contains rest of http-header at the beginning of file. It seems like SkipHeader can not correctly skip end of header.
dnld_a

@jkearins
Copy link
Author

jkearins commented Oct 8, 2017

Got it. I added extra input field in form tag and parseRequest() cannot find the begin of binary data in request. To use extra fields parseRequest() should process Content-Disposition but I think it goes beyond the scope of the project.

@flyinggorilla
Copy link
Contributor

I have added file-upload to storage capabilities and scanning for file name in multipart-form-upload header in this project. at some point i may port it over to the ufo project. https://github.com/flyinggorilla/esp32gong maybe it helps you.

@jkearins
Copy link
Author

jkearins commented Oct 8, 2017

oh, thank you. I see you extracts filename from content-disposition and uses it to create file. Adding extra fields is still unsupported. I think it is better to create file with temporary name, put filename from content-disposition to mParams, put form fields and values to mParams too. So, we could able to reach this parameters in DynamicRequestHandler and in case of success do rename temp file to desired name and put it to desired folder.

@jkearins
Copy link
Author

I released parseRequest() with multuple input fields in multipart/form-data form. If you are interested in it I can publish the source. Best regards.

@flyinggorilla
Copy link
Contributor

sure, very much appreciated. please go ahead and create a pull request. thx. I will test it first in esp32gong project and eventually port it over to the ufo-esp32. so maybe its easier to post it there.

@jkearins
Copy link
Author

I cloned esp32gong and added changes to my fork: https://github.com/jkearins/esp32gong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants