通过WP7中的POST方法上传在WebServer上上传视频
-
09-12-2019 - |
题
我想将视频上传到我的webserver。我使用reastharp作为webclient。我能够通过addfile()post方法上传图像。但我不知道如何上传视频文件。我正在孤立的存储中存储录制的视频,现在我想将视频摘选从孤立的存储器上传到我的Web服务器。
如果有类似的WP7相似的人,请告诉我你的建议吗?
解决方案
First load your video from isolated storage into a byte array, then you can upload it:
byte[] data;
using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream stream = storage.OpenFile("MyVideo.wmv", FileMode.Open))
{
data = new byte[stream.Length];
stream.Read(data, 0, (int)stream.Length);
}
}
request.AddFile("video", data, "MyVideo.wmv");
不隶属于 StackOverflow