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

CGI POST multipart/form-data deletes uploaded files before application can access them #19

Open
shattar opened this issue Feb 1, 2019 · 0 comments

Comments

@shattar
Copy link

shattar commented Feb 1, 2019

When "BOOST_CGI_KEEP_FILE_UPLOADS" is not defined and "BOOST_CGI_NO_BOOST_FILESYSTEM" is not defined, the form_part destructor deletes the file. This sounds good, except for when the form_part is a local variable in the form_parser::parse_form_part method and the file gets deleted when the local variable goes out of scope. So, what ends up happening is that the form_parser::parse_form_part method parses the part, creates the file, then deletes it upon return.

I ended up defining "BOOST_CGI_KEEP_FILE_UPLOADS" and handled cleaning up the uploaded files at the application level.

@shattar shattar changed the title CGI POST multipart/form-data deletes uploaded files before application can get it CGI POST multipart/form-data deletes uploaded files before application can access them Feb 1, 2019
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

1 participant