Closed sunli829 closed 4 years ago
can you share the error messages?
impl ContentDisposition {
pub fn parse(headers: &HeaderMap) -> ContentDisposition {
let content_disposition = headers
.get(header::CONTENT_DISPOSITION)
.and_then(|val| val.to_str().ok()); // HeaderValue::to_str will make an error, maybe you should just parse bytes?
let field_name = content_disposition
.and_then(|val| constants::CONTENT_DISPOSITION_FIELD_NAME_RE.captures(val))
.and_then(|cap| cap.get(1))
.map(|m| m.as_str().to_owned());
let file_name = content_disposition
.and_then(|val| constants::CONTENT_DISPOSITION_FILE_NAME_RE.captures(val))
.and_then(|cap| cap.get(1))
.map(|m| m.as_str().to_owned());
ContentDisposition { field_name, file_name }
}
}
Okay, let me check.
Thank you. 😀
Hey @sunli829 , I pushed the fix to feature/utf8-content-disposition
branch. Can you please test it and let me know if it's working and then I will make a release,
[dependencies]
multer = { git = "https://github.com/rousan/multer-rs", branch = "feature/utf8-content-disposition" }
Thank you. I'll test it tomorrow morning. 😀
It's working very well now. Thank you very much! 😁
Filename: 你好.txt