Last post Jan 18, 2017 07:50 AM by Cathy Zou
Jan 05, 2017 10:43 AM|Lexi85|LINK
I have a "Preview" hyperlink...which on clicking should open a file from the location on textbox...though the location in not in the project folder...how do I do that?
I have used below code, which displays the file from project folder and in new tab...
I need to write a code which displays text file from any location in a new pop up window....
<asp:Textbox ID="Textboxlocation" runat="server" enabled="false" Text=""></asp:Textbox>
<asp:HyperLink ID="HyperLink1" Text="Preview" runat="server" autopostback="true" NavigateUrl="~/testing.txt" Target="_blank" ></asp:HyperLink>
How do I make it open in from any location?
Jan 05, 2017 11:54 AM|PatriceSc|LINK
Where it is? If it is server side but not Under the site folder you need to reach a location that would read this file from its actual location to send this back to your browser. By definition you can't reach directly a file if it is not available on your
If client side. you can use an input type="file" control and which a modern browser you can access to the file content to perhaps do a preview (depending on its type) before uploading the file...
If on a dev machine keep in mind that when running on a real site, the user won't have access to the server drive.
Jan 05, 2017 12:33 PM|Lexi85|LINK
the file can be stored anywhere on the local machine this user is using tthe application from
Jan 18, 2017 07:50 AM|Cathy Zou|LINK
far as I know. I think that your requirement is not realized and is impossible to do.