You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproduces how often: [What percentage of the time does it reproduce?]
Versions
OS version (if on linux, the output of "uname -a")
libhttpserver version (please specify whether compiled or packaged)
libmicrohttpd version (please specify whether compiled or packaged)
If you have problems during build:
Compiler version
autotools version
Additional Information
Any additional information, configuration (especially build configuration flags if you compiled the libraries) or data that might be necessary to reproduce the issue.
If you have problems during build, please attach your config.log and the full scope of your error from make.
If you have problems at execution, please:
attach the stacktrace in case of crash (a coredump would be even better).
provide a main that reproduces the error.
The text was updated successfully, but these errors were encountered:
XinHengW
added
the
bug
Confirmed bugs or reports that are very likely to be bugs.
label
May 19, 2022
Run httpserver and upload files by post. After uploading, the uploaded files will be automatically deleted by httpserver.
After changing the code like this: MHD_Result webserver::complete_request(MHD_Connection* connection, struct details::modded_request* mr, const char* version, const char* method) { mr->ws = this; mr->dhr->set_path(mr->standardized_url->c_str()); mr->dhr->set_method(method); mr->dhr->set_version(version); /*I changed!*/ _http::file_info& file = mr->dhr->get_or_create_file_info(mr->upload_key,mr->upload_filename); std::string real_name =mr->ws->file_upload_dir + "/" + mr->upload_filename; rename(file.get_file_system_file_name().data(),real_name.data());_ /*end*/ return finalize_answer(connection, mr, method); }
The file can be saved under its real name.
When the "rename()" function is commented out, no files can be saved.
step of reproduce:
1 run httpserver /home/data
2 upload "test.txt" by postman
3 can't find any file uploaded
Prerequisites
Description
[Description of the issue]
Steps to Reproduce
Expected behavior: [What you expect to happen]
Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
Versions
If you have problems during build:
Additional Information
Any additional information, configuration (especially build configuration flags if you compiled the libraries) or data that might be necessary to reproduce the issue.
If you have problems during build, please attach your config.log and the full scope of your error from make.
If you have problems at execution, please:
The text was updated successfully, but these errors were encountered: