I've always heard/ assumed you couldn't view a txt file in an iframe
but with this:
<html><iframe src ="file:///C:\Users\Owner\Documents
\testingtesting2.txt"
width="50%" align="center" height="600"></iframe></html>
It works - i.e. I can actually see what's in that file.
I'm trying to be able to browse for a file from the tiddler and use
that form value to use as the actual file I want to look at. So I
copied the "Browse My Hard Drive" thing from Dave Gifford's TiddlyDu
( ttp://www.giffmex.org/tiddlydu2.html#%5B%5BBrowse%20my%20hard%20drive%5D%5D)
and added them together to get this:
<html><div align="left"><FORM name=form1><INPUT type=file name=cmuds>
<INPUT onclick="whatFile()" type=button value=OpenFile name=button></
FORM></div><br>
<iframe src ="file:///C:\Users\Owner\Documents\testingtesting2.txt"
width="50%" align="center" height="600"></iframe></html>
I've tried replacing the file name with form1, "form1", cmuds,
"cmuds", "OpenFile", OpenFile, and nothing's working.
I obviously don't know what the heck I'm doing.
Could someone take pity on me and show a chronic question asker the
light?
Dave Parker
PS I also couldn't get the Open File button to work in the first place
(as it sits in Dave's page there)
This may seem like a goofy thing to do, e.g. why do this if you can
just link to the text file and view it there directly?
The reason is that you can't use tiddlysnip from a text file, but you
can from an iframe.
(I take a lot of notes on pocket pc and would like to incorporate my
ppc txt system into my desktop TW system)
that way I could really GetThingsDone
thanks in advance to any takers...
DP
Here's some light:
http://www.tiddlytools.com/#FAQ_LocalFilesWithIFRAME
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
DP
Select a local file and display it in an IFRAME embedded in a tiddler
Here's a "pure HTML" embedded form that lets you to select and view
almost any local file in an IFRAME. It uses the browser-provided
platform-specific "select a file" dialog box to fill the "whichfile"
input field (which you can also type into, if you like). The IFRAME
that follows the form has a specified name/id (use both attributes for
compatibility with older browsers), which is also used as the form's
target. When you click the "open" button, it sets the form action to
refer to the selected path/file (pre-pending file:/// so it can be
seen as a URL by the browser). Then, it triggers the form's submit()
handler, causing the form's action (the selected file/path URL) to be
loaded and displayed in the target IFRAME. Note: this form may also
work with file types other than "text"... it all depends upon your
browser's support for those file types...
<html>
<form target="theFrameID">
<input type=file name=whichfile>
<input type=button value="open"
onclick="var f=this.form; f.action='file:///'+f.whichfile.value;
f.submit();">
</form>
<iframe src="" name="theFrameID" id="theFrameID"
style="background:#fff;width:100%;height:500px">
</iframe>
</html>
see also:
http://www.TiddlyTools.com/#FAQViewer
http://www.TiddlyTools.com/#FAQViewerPlugin
-e