hi
i have created application that uploaded files (.zip, .doc, ... any type ) to file system and then i have create another code to download the files but i need so have the option to open also the file if i do not need to save it on my computer can any one helpe me to do that
this some code how i download:
System.Web.UI.WebControls.FileUpload inputFile;
inputFile = ((System.Web.UI.WebControls.FileUpload)Evidence_GridView.Rows[0].Cells[5].FindControl("Evidence_FileUpload"));
if ((!(inputFile.PostedFile == null) && (inputFile.PostedFile.ContentLength > 0)))
{
string fileName = case_id + " " + IncroControl.getIncro() + " " + System.IO.Path.GetFileName(inputFile.PostedFile.FileName);
string saveLocation = (this.Page.Server.MapPath(".\\Data\\Evidence") + ("\\" + fileName));
try
{
// Save the file.
inputFile.PostedFile.SaveAs(saveLocation);
CMDObj.Parameters.Add("@Attached_File", SqlDbType.NVarChar).Value = fileName;
}
catch (Exception ex)
{
this.Page.Response.Write(("Error: " + ex.Message));
}
}
else
{
CMDObj.Parameters.Add("@Attached_File", SqlDbType.NVarChar).Value = "";
}
best regards,