How can i get name and mime-type using ImagePicker? In url i creates a copy of file with hash-name, but i need original name
The API doesn’t currently return the image name, the name would not generally be useful because it is auto generated by the system (unless loaded by user onto an Android phone). Can you describe the case where returning the original name would be useful? We may consider adding it into a future release.
The mime-type can be inferred from the extension on the uri returned in the result, but is not returned in the result.
I’m going to do image upload on server, so on site you can see image preview and it’s name a the bottom of it. I have found document picker with the type image/*, it returns right name, but I’m still unable to upload it because it’s uri starts with protocol content://
In general there is no well-defined name from the OS for an image that the user picks. You could have the user enter a name manually and just use that. Images are mostly just blobs of color data, with some metadata such as exif stuff (orientation, information about the camera, or such), but when a person takes a photo and saves it on the phone, what would be a nice name for it?
I agree that camera photos will have generated name, but not hash. Like IMG_201709010852
How would this be more useful than
'IMG_' + Math.random(4000)?