I am working on a project (asp.net web application) that takes files from users, stores them and retrieves or shows them back to the user when needed. I am saving files on my file system (drive). When I save image开发者_Python百科s and refer to them in iframes, images are being displayed in iframes. But when I save .html file and refer it in an iframe it is not displaying the html file. I want to store a .html file on my file system using file upload and store on my local drive, display it in an iframe. can someone help me??
Your browser may not be allowing a local html file to be opened for security reasons. Not sure if it is an option for you, but maybe instead of specifying a relative or absolute path on your file system, try serving the html file you want from your localhost:
<iframe src="http://localhost/path/to/yourFile.html" width="700" height="300" /></iframe>
精彩评论