我有一个WebApi项目和一个安卓客户端,我需要使用App42从WebApi上传一些图像,问题是,在this教程中,它必须有一个StringPath,但我没有stringPath,因为图像将由安卓客户端为Api发送,然后保存这些图像。我是否必须从安卓系统以Base64格式发送图像,然后创建一个位图格式的tempFileObject,然后将stringPath放入其中?
String name = "MyPic";
String userName = "Nick";
String filePath = " file path from gallery /sd card";
String fileType = "IMAGE";
String description = "This is my holiday pic";
Upload upload = uploadService.UploadFileForUser(name,userName,filePath,fileType,description);
// File will get uploaded in App42 cloud with above snippet.
IList<Upload.File> fileList = upload.GetFileList(); // This will have only single file uploaded above
for (int i = 0; i < fileList.Count; i++)
{
Console.WriteLine("fileUrl is " + fileList[i].GetUrl());
//This will return uploaded file URL
}发布于 2017-07-17 15:06:55
如果我理解了这个查询,那么您没有将文件保存在设备的本地文件存储中。如果是,那么您可以使用another API,它将询问您图像的InputSteam作为参数。
我希望这能帮到你。
https://stackoverflow.com/questions/42523218
复制相似问题