How to Download the a Video,Audio, PDF, etc into a Local Storage

Posted by Vuyiswamb under Mobile Development on 11/9/2013 | Points: 10 | Views : 1336 | Status : [Member] [MVP] [Administrator] | Replies : 0
Good Day All

i have some video and Audio Files that i would like the user to download to the Local Storage and after being downloaded it must be viewed.i tried the following code.

  string m_Url = "";//string.Empty;

private void btnDownload_Click(object sender, RoutedEventArgs e)
Button button = sender as Button;
if (button.Tag.ToString() != string.Empty)

// m_Url = button.Tag.ToString();

//Obtain a virtual store for application
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();

if (!fileStorage.DirectoryExists("BOOKS"))
//Create new subdirectory

//Create a new StreamWriter, to write the file to the specified location.
StreamWriter fileWriter = new StreamWriter(new IsolatedStorageFileStream("BOOKS\\" + GenericFunctions.GetFileNameinURL(m_Url), FileMode.OpenOrCreate, fileStorage));


if (fileStorage.FileExists("BOOKS\\" + GenericFunctions.GetFileNameinURL(m_Url)))
MessageBox.Show("Download Complete");

GenericFunctions.PlaySound("BOOKS\\" + GenericFunctions.GetFileNameinURL(m_Url));



Thank you for posting at Dotnetfunda


(No response found.)

Login to post response