Do multipart form file uploads keep the image metadata? #3010
-
Hey all (and I hope I have put this in the right place), I was curious to know if the multipart file uploads (which it looks like it uses the TempFile crate (judging from the example here: https://github.com/actix/examples/blob/463b76ef8a847b7f946fc0f6407f82a52395cd5f/forms/multipart/src/main.rs#L20-L30). Does anyone know if I could extract any image metadata from the original file? Playing around with the crate it looks like when you receive the TempFile on the Actix Web side of things, it looks like the file metadata on the tempfile is reset to the time that it was uploaded to the server? Perhaps I am doing something incorrectly. My usecase is that I have a bunch of photos that I want to upload to the actix web server and I would like to (ideally) upload the photos as they are, image metadata intact (then I can do some post processing once the image itself is safely secured on the server...but if the TempFile or the multipart mechanism drops the image metadata then I guess I assume I would have to extract the image metadata separately and upload that separately (maybe it can be part of the same form that is being uploaded to the rust server)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The createdAt/modifedAt metadata of any tempfile will be set once it's uploaded to the time of the upload. It's not possible, afaik, to transfer this filesystem metadata when doing multipart uploads. Many image formats, such as JPEG, have additional metadata that can be extracted, usually EXIF format which will contain original capture date and other camera info. |
Beta Was this translation helpful? Give feedback.
The createdAt/modifedAt metadata of any tempfile will be set once it's uploaded to the time of the upload. It's not possible, afaik, to transfer this filesystem metadata when doing multipart uploads.
Many image formats, such as JPEG, have additional metadata that can be extracted, usually EXIF format which will contain original capture date and other camera info.