0

我有一个 WebApi 项目和一个 Android 客户端,我需要使用 App42 从 WebApi 上传一些图像,问题是,在教程中,它必须有一个 StringPath,但我没有 stringPath,因为图像将是由 Android 客户端为 API 发送,然后保存这些图像。我是否必须将 Android 中的图像作为 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  
}
4

1 回答 1

0

如果我理解该查询,那么您没有将文件保存在设备本地文件存储中。如果是,那么您可以使用另一个 API,它会询问您图像的 InputSteam 作为参数。

我希望这有帮助。

于 2017-07-17T07:06:54.670 回答