Jump to content

URL link to filesystem


skafy

Recommended Posts

Hi,

I wonder how is it possible (if it is) to show content of one x folder in browser. I tried to use label with <a href> with following lines

  • <a href="C:\FB6\">Link text</a>
  • <a href="file:///C:FB6/">Link text</a>

It just starts processing and than "page crash" - timeout & refresh button shown

In browser console it says - Prevented navigation to “c:\FB6\” due to an unknown protocol.

 

How can this be done? If I enter file path manualy in new tab it works - like shown below.

image.png.2d96e2006269a6e056bbe2a24627cf80.png

Link to comment
Share on other sites

43 minutes ago, Sherzod said:

Hello,

Your case is not very clear. 

Where do you want to open, in a separate tab?

Yes in a sepetate tab.

Bellow code example also don't work.

UniSession.AddJS('window.open(twAttachmentList.Selected.Text +'?fake='+dt+'")');    

 

Link to comment
Share on other sites

16 hours ago, picyka said:

If I understand correctly,

you need to view files from the server in the browser.

I did something similar,

but I did it with an api

Sorry if I'm wrong.

Yes I need to view files from shared folder.

It seems like I cannot open new tab with folder view. Also found this..https://stackoverflow.com/questions/18246053/how-can-i-create-a-link-to-a-local-file-on-a-locally-run-web-page

Quote

You cannot cross from http(s) to the file protocol

Modern versions of many browsers (e.g. Firefox and Chrome) will refuse to cross from the http(s) protocol to the file protocol to prevent malicious behaviour.

This means a webpage hosted on a website somewhere will never be able to link to files on your hard drive. You'll need to open your webpage locally using the file protocol if you want to do this stuff at all.

How did you did it with API?

Link to comment
Share on other sites

13 hours ago, skafy said:

How did you did it with API?

 

Due to security reasons the user has to select the files first. Quoting from above source:

Quote

Before the HTML5 file API can access a file from the local file system, the user has to select the file to give access to. For security reasons selecting files is done via the <input type="file"> HTML element. Here is an input element example:

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...