如何使用App42上传图像

时间:2017-03-01 04:30:42

标签: android asp.net-web-api app42

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

1 个答案:

答案 0 :(得分:0)

如果我理解了查询,那么您就不会在设备本地文件存储中保存文件。如果是,那么您可以使用another API来询问图像的InputSteam作为参数。

我希望这会有所帮助。