?
Solved

Local files in IFRAME

Posted on 2004-11-03
6
Medium Priority
?
525 Views
Last Modified: 2009-12-16
Hey all,

I'm developing an application that requires an IFRAME to display a dynamic URL. This url can be a file (file://), web page (http://), or (ftp://). My question is about the file. When I give set the IFRAME src to something like "file://d:\test.html" I get nothing but a blank html.
Can someone please direct my attention to what may be causing this and how to fix it?

Thanks.
0
Comment
Question by:hmstechsupport
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:mrwebdev
ID: 12488640
If the file  is on a web server / website and it's in the root you can use:

<IFRAME SRC="test.html" TITLE="Test IFRAME" SCROLLING="auto" NAME="test" WIDTH="500" HEIGHT="150" ALIGN="center" FRAMEBORDER="yes">
</IFRAME>

or absolute
<IFRAME SRC="http://www.yourwebsite.com/test.html" TITLE="Test IFRAME" SCROLLING="auto" NAME="test" WIDTH="500" HEIGHT="150" ALIGN="center" FRAMEBORDER="yes">
</IFRAME>


Good Luck hope this helps!
0
 

Author Comment

by:hmstechsupport
ID: 12496555
I understand how to navigate to files via IFRAME. What i'm trying to get at is totally different. Here is an example:

I am a user using my web application. Inside the application is an IFRAME that contains a URL of my choice. As the user, I would like to have a text file that I created show up in the IFRAME. So, I've created my text file, test.txt, and set the URL to appear as 'file://c:\test.txt'
When attempting to view this text file in my IFRAME the next time I load the application the IFRAME turns up blank. How come the text file isn't displayed?

This is the question to ponder. Thank you for your response though.
0
 

Author Comment

by:hmstechsupport
ID: 12496587
P.S. the IFRAME tag would look like <IFRAME src="file://c:\test.txt">

this works locally but not on a server.
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
LVL 31

Accepted Solution

by:
seanpowell earned 2000 total points
ID: 12503770
I believe you need to use a UNC for this to run it from the server:

src="file://ServerName/Path/test.txt"
0
 

Author Comment

by:hmstechsupport
ID: 12507129
Sorry for the delay, i was responding to say thanks when we had a power failure. Thanks seanpowell. Just to follow up, I discoverd that the protocol must read file:/// with 3 /'s.

Thanks Again!
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 12507215
I hate power failures...

Thanks for the A :-)
Sean
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question