Last post Jul 07, 2008 07:04 AM by krishnakumari
Jul 07, 2008 07:04 AM|krishnakumari|LINK
I am developing a web application in that one task is downloading the video file to the mobile or ipods.
when I was searching I got this code to download. but the problem is we have to restrict the user to download on system.
I should allow user to download to mobile directly through bluetooth or data cable.
protected void Button1_Click(object sender, EventArgs e)
string url1 = Session["sname"].ToString();
string AppPath = Request.PhysicalApplicationPath;
AppPath = AppPath + url1;
//string filepath = Server.MapPath(url1);
// Create New instance of FileInfo class to get the properties of the file being downloaded
FileInfo file = new FileInfo(AppPath);
// Checking if file exists
// Clear the content of the response
// LINE1: Add the file name and attachment, which will force the open/cance/save dialog to show, to the header
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
// Add the file size into the response header
// Set the ContentType
Response.ContentType = ReturnExtension(file.Extension.ToLower());
// Write the file into the response (TransmitFile is for ASP.NET 2.0. In ASP.NET 1.1 you have to use WriteFile instead)
// End the response
could you please provide the assistance for me to complete this task.
provide me some help full link.