我有一个 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
}