-1

I have the problem to show the html file on local drive in my aspx page on IE9. I have read the question at how to set iframe src to local file.

I can show the html file which is on the another drive on the server by the below code.

 <iframe src="\\servercomputer\G$\test6.html" title="test" />

I don't want people see my actual folder location. I tried to create the virtual directory under the website, but I got the "cannot find the page error" Would someone show me what I should do.

Thanks in advance.

Community
  • 1
  • 1
user819774
  • 1,456
  • 1
  • 19
  • 48
  • You were going through the right route (virtual directory). What went wrong? – emerson.marini Oct 04 '13 at 21:29
  • 1
    I don't get the downvote. The OP has a genuine question and has shown some kind of effort. – emerson.marini Oct 04 '13 at 21:30
  • @MelanciaUK,I found that the file path is not correct. It returned c:\HTML\test.html'. My folder is on s: driver Webconfig: The snap code in my aspx page Dim fileName As String =”test.html” Dim sLogServer As String = AppSettings("HtmlFolder")Dim severpath As String = Server.MapPath(Request.ApplicationPath & sLogServer).ToString Dim text As String = System.IO.File.ReadAllText(sLogServer & fileName) I also tried use String = Server.MapPath(sLogNotesServer).ToString It got the same wrong path. What’s wrong and how I correct it? Thank. – user819774 Oct 08 '13 at 18:42

1 Answers1

1

It's possible to have virtual directory that points at a network location - you will have to play with the "Connect As" and specify name/password for access: IIS Virtual Directory map to network drive (with drive letter) but fail to create file

Another way (possibly better) would be to have a proxy in C# that would download the file from another server

Community
  • 1
  • 1
Artemiy
  • 1,969
  • 14
  • 19