Question

I would like to upload the video to my webserver.currently I am using RestSharp as a webclient. I am able to upload the images through AddFile() post method. but I donot know how to upload the video file. I am storing the recorded video in isolated storage and now I want to upload the video picking from isolated storage to my webserver.

please let me know your suggestions if anyone similar did for WP7?

Was it helpful?

Solution

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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top