-3

I have a FileUpload Widget.

FileUpload fileUpload = new FileUpload();

Window.alert(fileUpload.getFilename());

When I run in development mode using firefox then it alerts filename.doc

But when I run in development mode using chrome it alerts C:]fakepath\filename.doc

Anybody know its reason?

Parvathy
  • 2,275
  • 3
  • 24
  • 39

1 Answers1

0

All browsers should hide the actual path the filename comes from, but they do so in different ways. There is no standard for this.

Basically, you should look for the last slash or backslash character in the filename (if either exists) and remove anything that comes before it to get the "plain" filename.

j__m
  • 9,392
  • 1
  • 32
  • 56