経由でファイル(VideoFile) をサーバーにアップロードしたい。 BackgroundTransferService
私の問題は、ファイル(POSTリクエスト)とともに2つのパラメーターも送信したいということです。
BackgroundTransferService
それで、 APIを使用しながら、ファイルのアップロードとともにパラメーターを送信することは可能ですか..?
コード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);
}
誰かがより多くの情報を必要とし、私の質問を理解できない場合は尋ねてください.
迅速な対応が欲しいです。はいまたはいいえ.. はいの場合、どのように..?