Select File or Dir from Virtual Folder
Virtual Folder contains File Picker and Upload-Dir Picker components. They can send a message containing an URL of the selected File or Directory using cross-document messaging API. The integration is done by following:
The web page (e.g.
myfilepicker.html
) is hosted by [yourweb]the following Javascript code in your web pages opens pop-up browser window with
filepickercomponent.html
anduploaddirpickercomponent.html
hosted by West-Life portal.The
receiveMessage
Javascript function gets the url of picked file or dir via cross-document messaging API.
Shared Script Code
Add the following javascript code into your web page (myfilepicker.html
):
File picker
The filepickercomponent.html
is hosted by west-life portal and returns an URL pointing to the file. HTTP GET of that URL lead to download the file.
Add the following HTML snippet into your web page (myfilepicker.html
). It will open West-life filepicker component in popup window:
Note: 'fileid'
links to the element where the URL of chosen file will appear later.
Upload Dir Picker component
The uploaddirpickercomponent.html
is hosted by west-life portal and returns an URL pointing to the directory. You can HTTP POST or use WEBDAV access to that directory to upload files.
Add the following HTML snippet into your web page (myfilepicker.html
). It will open West-life uploaddir picker component in popup window:
Note: 'uploaddirid'
links to the element where the URL of chosen file will appear later.
This reuses the same javascript as for filepicker component.
References
:Cross-document Messaging: https://html.spec.whatwg.org/multipage/comms.html#web-messaging
Last updated