How to access a local file in webcomponent.

Hi All ,

I have a webcomponent . As the webcomponent runs on the client side . How to access the a file with this path “C:\Users\ASHUTO~1.LEN\AppData\Local\Temp\1svy6635317187690402265.jpg”

In my case this is not visible in the ngclient . But visible in the designer . How this can be made possible ?

Not possible,

an NGclient (or any websolution) does not heave direct access to your local file system!

How can we access the file ? . Do we need to stream files to server ? . Do we need to move to default file upload location ? . But still I cannot access it .

I am giving a example server path “C:\ServoyFinal\Installation\application_server\server\webapps\ROOT\uploads\Delete_icon7061898935877499997” . But this is not working .

Can you please provide an example.

Please provide some suggestions.

Hi ,

I finally got that . we have to access that using application.getServerURL.

Again, from within the browser you cannot read files on the user’s hard drive. Imagine a website could do that!?

Not sure what you mean with getServerUrl? That will never do anything useful in a real browser (it might work in developer, because there you sit on the server).

When you want a file from the user’s hard drive, the user has to select that file. You can’t just read it. This works only in smart client.

Have a look at https://wiki.servoy.com/display/DOCS/file

Patrick I mean to say we have to move the file to the server . Then we can access it .

If you look at the wiki you see that after a file upload your callback method receives the file as argument. No need to deal with the server hard drive at this point.

actually in our case we are using devexpress file uploader , not the default Servoy one . and we want to show the preview of the file before it is uploaded.