Posted on: 1/16/2015 5:57:46 AM | Views : 578

 Hi
In asp.net application I uploaded file in web directory and storing physical file path in database
I have written code for uploading
I have root folder BCRMV2
BCRMV2
**Masters
****Uploads folder(All uploaded files are stored)
****UploadFile.aspx
**Reports
****DisplayVendor.aspx(Downloading file)

The below code is in Uploads folder
protected void Button1_Click1(object sender, EventArgs e) {
try {
if (flUpload.HasFile) {
foreach (HttpPostedFile postedFile in flUpload.PostedFiles) {
if (flUpload.PostedFile.ContentLength < 20728650) {
string fileName = Path.GetFileName(postedFile.FileName); string s1 = ""; s1 = Server.MapPath("Uploads") +"\\"+ System.IO.Path.GetFileName(postedFile.FileName);// this is stored in database table

postedFile.SaveAs(Serve ...

Go to the complete details ...