Upload files save in folder and display in ASP.Net GridView with View and Delete option
but i can give one path at a time, if i want to view all the file of grid view then how can i do it.
Grid View :
Id |
File Name |
File Type |
Data |
Link |
1 |
abc |
.pdf |
Binary Data |
View |
2 |
pqr |
.doc |
Binary Data |
View |
3 |
xyz |
.png |
Binary Data |
View |
|
When you click on view it should open / preveiw abc.pdf file in pdf format
string fileName = Server.MapPath(@"~/Uploads/" + e.CommandArgument.ToString());
Process process = new Process();
process.StartInfo.UseShellExecute = true;
if (File.Exists(@"C:\Users\Administrator\Desktop\NEW\WebApplication22\WebApplication22\Uploads\residence.pdf"))
{
ProcessStartInfo psStartInfo = new ProcessStartInfo();
psStartInfo.FileName = @"C:\Users\Administrator\Desktop\NEW\WebApplication22\WebApplication22\Uploads\residence.pdf";
Process ps = Process.Start(psStartInfo);
}
else
{
// MessageBox.Show("File not found");
ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('File Not found');", true);
}