Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create a link to a local file/directory

PamNLSep 11 2014 — edited Sep 11 2014

In my application I have created an upload attachment function. Here you can upload either files or make a reference to a URL.

This works fine, but the users like to make a reference to a local file and/or directory instead of uploading the file, because then you get a local copy of the file in your database.

Their idea is that they make a pointer to a directory on a shared server so people can browse the most current files in that directory. It could also be a pointer to the file itself instead of the directory.

If you use a regular browser you can type stuff like

file:///c:/temp

to refer to your local directory. Or use something like file:///c:/temp/test.docx and the browser will open Word if setup correctly.

I've tried creating the URL this way .. so you store the value in the database and in the report I make the column a link column with target URL and go to #LINK#, where Link is the column name.

For regular urls, like http://www.oracle.com this works fine, but for the file urls nothing happens.

So I tried something else .. when you click on the item I navigate to another page and this page does in load header

window.open('file:///c:/temp');

Note that if I try with window.open('http://www.oracle.com') it works fine, it opens the window.

My idea was to make it

window.open ('file:///c:/temp','_self');

eventually so you would not see it opened something and it would open the file directory instead. If you copy file:///c:/temp directly in the browser navigation bar it does open the file directory.

I've also tried to do it in the report directly

'<a href= ... </a>'

But that just displays as text.

Any thoughts on how to get this working??

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2014
Added on Sep 11 2014
1 comment
858 views