我想通过.将文件(VideoFile) 上传到服务器。 BackgroundTransferService
我的问题是,我还想连同文件(POST 请求)一起发送 2 个参数。
那么,是否可以在使用 API 时将参数与文件上传一起发送BackgroundTransferService
..?
代码BackgroundTransferService
:
BackgroundTransferRequest req = new BackgroundTransferRequest(new Uri("ServerURL", UriKind.Absolute));
req.Method = "POST";
req.TransferPreferences = TransferPreferences.AllowCellularAndBattery;
string uploadLocationPath = "/Shared/Transfers/myVideoFile.mp4";
string downloadLocationPath = "/Shared/Transfers/response.txt";
req.UploadLocation = new Uri(uploadLocationPath, UriKind.Relative);
req.DownloadLocation = new Uri(downloadLocationPath, UriKind.Relative);
req.TransferProgressChanged += req_TransferProgressChanged;
req.TransferStatusChanged += req_TransferStatusChanged;
try
{
BackgroundTransferService.Add(req);
}
catch (Exception ex)
{
MessageBox.Show("Unable to add video to upload queue.\nPlease try again later.", App.appName, MessageBoxButton.OK);
}
请询问是否有人想要更多信息并且无法理解我的问题。
我想要一个快速的回应。是或否.. 如果是,那么如何..?