WP7의 POST 메소드를 통해 웹 서버에 비디오 업로드
-
09-12-2019 - |
문제
iVyweberver에 비디오를 업로드하고 싶습니다. 현재 RESTSHARP를 WEBCLIENT로 사용하고 있습니다.AddFile () Post 메서드를 통해 이미지를 업로드 할 수 있습니다.그러나 비디오 파일을 업로드하는 방법을 알고 있습니다.격리 된 스토리지에 녹화 된 비디오를 저장하고 있습니다.
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