In aspx file
---------------
using System;
using System.Web;
using System.IO;
file.SaveAs(Server.MapPath("~/videos/") + file.FileName);
Stream streamfile = file.InputStream;
OR
In ashx file
---------------
using System;
using System.Web;
using System.IO;
HttpPostedFile file = null;
if (context.Request.Files.Count > 0)
{
file = context.Request.Files[0];
file.SaveAs(HttpContext.Current.Server.MapPath("~/videos/") + file.FileName);
Stream streamfile = file.InputStream;
}
---------------
using System;
using System.Web;
using System.IO;
file.SaveAs(Server.MapPath("~/videos/") + file.FileName);
Stream streamfile = file.InputStream;
OR
In ashx file
---------------
using System;
using System.Web;
using System.IO;
HttpPostedFile file = null;
if (context.Request.Files.Count > 0)
{
file = context.Request.Files[0];
file.SaveAs(HttpContext.Current.Server.MapPath("~/videos/") + file.FileName);
Stream streamfile = file.InputStream;
}
No comments:
Post a Comment