'How can I open a network document without downloading it first
I have an existing asp.net web application that allows users to upload files to a network location, then lists those files in a gridview which they can select to access them. This was originally written for IE which opens the actual file on the network and can be edited and resaved without needing to download/save locally. I have been unable to find a similar solution that works in Chrome, Edge, Firefox etc. Can anyone point me to a solution where the user can open the document in it's default program for editing without needing to save a local copy?
Current code: Protected Sub gvAttachments_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvAttachments.RowDataBound
' Make sure this is a datarow being bound
If e.Row.RowType = DataControlRowType.DataRow Then
'Make FileName a hyperlink
Dim fileName As String = e.Row.Cells(0).Text
Dim hl As New HyperLink
hl.Target = "_blank"
hl.Text = fileName
hl.NavigateUrl = Me.attachmentLocation + fileName
e.Row.Cells(0).Controls.Add(hl)
End If
End Sub
I also tried to use this code which prompts for the document to be saved instead of opening it directly: System.Diagnostics.Process.Start(filename)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
