GWT: fileUpload.getFileName () & fakepath

I am working on a GWT project (web application):

at some point, users can upload a file through the application through FormPanel.

Since I need a file name, I thought I could use:

    FileUpload upload = new FileUpload();
    // ...
    String name = upload.getFileName();

And nameit turns out like this: C:\fakepath\whatever.txt.

Is it cross platform? What happens on another OS (I use Windows)?

+5
source share
1 answer

The name returned by the download form depends on the browser security settings.

In windows, C: \ fakepath is used to obscure where the file is located. However, the file name is always saved.

os'es, C:\fakepath ( 100% , , Linux).

GWT, FileUpload; os'es ( () ). Windows, Ubuntu OS/x. , "/" "\" ( , ) getFileName :).

+5

All Articles