Here are some examples of valid UNC paths:
- C:\Documents and Settings\Bob\Desktop\listing.txt
- C:\server\logs\log.txt
- \\Server\Shared Folder\Updates\server_log.xml
Klip Security Model
Using the API call below requires running with developer mode enabled and having the XML <scriptmode>extended</scriptmode> within the Klip's <setup> block, as shown below.
<setup>
<scriptmode>
extended
</scriptmode>
</setup>
In order to use this object without the Developer Mode turned on, you must have your Klip digitally signed by Klipfolio Inc.
Example Klip: Using UNC path in <contentsource>
You don't have to use the File API in a Klip if you just want to access a file. You can use a UNC path in <contentsource> by prefixing the path with file:///.For example, following Klip uses a <contentsource> on the local file system.
<locations>
<contentsource>
file:///c:\temp\test.xml
</contentsource>
</locations>
<klip>
<identity>
<title>
API: File contentsource example
</title>
</identity>
<locations>
<!--
Place the contents of
http://support.klipfolio.com/files/demo/demo.xml
at
c:\temp\test.xml
and reload this Klip.
-->
<contentsource>
file:///c:\temp\test.xml
</contentsource>
<icon>
http://www.klipfolio.com/static/klips/klipfolio/sample_icon.png
</icon>
<banner>
http://www.klipfolio.com/static/klips/klipfolio/sample_banner.png
</banner>
</locations>
<setup>
<scriptmode>
extended
</scriptmode>
</setup>
<style>
alert {
type: item;
}
sender {
itemcol: 2;
noterow: 1;
label: 'Sender';
emphasis: strong;
}
summary {
itemcol: 3;
noterow: 4;
wrap: false;
notelabel: false;
}
date {
itemcol: 4;
noterow: 2;
label: 'Date';
}
category {
noterow: 3;
label: 'Category';
}
level {
itemcol: 1;
noterow: 5;
notelabel: false;
type: image;
}
url {
type: link;
}
id {
key: override;
}
</style>
</klip>
| Function Summary | |
File
|
open( <String> UNC_path )
Creates a File object to query the contents of a file. |
| Function Detail |
open
File open( <String> UNC_path )
- Creates a File object to query the contents of a file.
Note: The function call to open() opens the file (if it exists), reads its contents, and closes when the function exits. This is why a Klipfolio Dashboard API does not need a close() function call.
-
Parameters:
UNC_path - to the file
-
Returns:
-
File object if the connection was successfully established; undefined if the connection was refused or the host not found.
|
Klipfolio Dashboard 5 API | ||||||||
| PREV OBJECT NEXT OBJECT | FRAMES NO FRAMES | ||||||||
| SUMMARY: PROPERTY | FUNCTION | DETAIL: PROPERTY | FUNCTION | ||||||||
© 2009 Klipfolio Inc. All Rights Reserved.
