| | |
How to open or download files iasp.net using c#
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2007
Posts: 41
Reputation:
Solved Threads: 0
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:
best regards,
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:
C# Syntax (Toggle Plain Text)
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,
Last edited by cscgal; Nov 6th, 2008 at 12:15 pm. Reason: Added code tags
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
Depending on the file, if you're downloading something to display specifically such as text, sure, otherwise if you need to pass it to an app such as zip files, word docs etc, you cant, the best you can do is temp files..
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Other Threads in the C# Forum
- Previous Thread: read a text file into a 3D array
- Next Thread: C# Forms: Handling GUI clicks during BackgroundWorker
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion cryptographyc#winformsencryption csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ hash httpwebrequest image index input install java keypress label list listbox listener mandelbrot math mouseclick mysql netcfsvcutil.exe operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox safari save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update upload usercontrol validate validation view visualstudio webbrowser windows winforms wpf xml






