uiimagepickercontroller - 获取从照片库中选择的图像的名称
我正在尝试将图像从 iPhone/iPod touch 上传到我的在线存储库,我已成功从相册中选取图像,但我遇到一个问题,我想知道图像的名称,例如 image1.jpg 或其他内容像那样。我如何知道所选图像的名称。
I am trying to upload the image from my iPhone/iPod touch to my online repository, I have successfully picked the image from Photo Album but i am facing one problem i want to know the name of the image such as image1.jpg or some thing like that. How i would know the name of the picked image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
AssetsLibrary.framework(UIImage*)[info valueForKey:UIImagePickerOriginalImage]
(将所选图像作为 UIImage 的实例) > 并导出实际的源文件(包括格式、名称和所有元数据)。这还具有保留原始文件格式(png 或 jpg)的优点。Instead of using the usual image picker method
(UIImage*)[info valueForKey:UIImagePickerOriginalImage]
which gives you the selected image as an instance of UIImage, you can use theAssetsLibrary.framework
and export the actual source file (including format, name and all metadata). This also has the advantage of the original file format (png or jpg) being preserved.我想知道确切的图像名称不会成为问题,而是为所选图像获取唯一的名称将解决您的目的,以便您可以将图像上传到服务器上并通过其名称跟踪它。也许这可以帮助您
从选择器中选择图像后,您可以生成一个唯一的名称并将其分配给选择的图像。
干杯
I guess knowing the exact image name would not be an issue rather getting a unique name for the picked image would solve your purpose so that you can upload the image on server and track it via its name. May be this can help you
After you pick the image from Picker you can generate a unique name and assign it to the Picked image.
Cheers