String fileName = "<Your_file_name>";
String userName = "Nick";
String description = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes ("许多快乐"));
String filePath = "Your Local File Path";
String fileType = "<Your_file_type>";
App42Log.SetDebug(true); //Prints output in your editor console
uploadService.UploadFileForUser(fileName, userName, filePath, fileType, description, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
public void OnSuccess(object response)
{
Upload upload = (Upload) response;
IList<Upload.File> fileList = upload.GetFileList();
for(int i=0; i < fileList.Count; i++)
{
App42Log.Console("fileName is " + fileList[i].GetName());
App42Log.Console("fileType is " + fileList[i].GetType());
App42Log.Console("fileUrl is " + fileList[i].GetUrl());
App42Log.Console("TinyUrl Is : " + fileList[i].GetTinyUrl());
App42Log.Console("fileDescription is " + System.Text.Encoding.UTF8.GetString (System.Convert.FromBase64String (fileList[i].GetDescription())));
}
}
public void OnException(Exception e)
{
App42Log.Console("Exception : " + e);
}
}