• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

browse button returning just filename in Firefox

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

once after selecting the filename and submit the form the firefox is sending only the filename without the full path.
for eg: if i select a file c:\text.htm the firefox is returning just text.htm as parameter.
Is there a way to pass the full path as parameter.
In IE it is working fine.
 
vijaya bacina
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anybody know the answer?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this.
[ June 01, 2007: Message edited by: Bear Bibeault ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not think firefox returns the fill path as a security measure.

what are you doing on the server to try to get the full path?

Eric
 
vijaya bacina
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
user should select a xml file from browse button and the server will parse the xml file and update the database accordingly. since firefox is returning just filename the servlet is not able to get the xml file
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vijaya bacina:
since firefox is returning just filename the servlet is not able to get the xml file



You should not need the file path in any case. How are you reading the file, with file I/O or with a file upload?

If the former, your system will ONLY work when the client and the server are on the same machine. Is this what you really intened?
 
vijaya bacina
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


where path=document.form.browse.value; which is equal to text.xml
file.exists() is returning false so not able to read the file.
the server and client will be on different machines. Is this not possible with firefox atall?
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firefox has nothing to do with it. If that code you posted runs on your server, then the File object refers to a file on your server, not to a file on the client. That just isn't how you upload a file, so there is no point in trying to make it work.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See the JSP FAQ on how to really perform a file upload.
 
vijaya bacina
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much.
I used apache commons for file upload and it is working fine now.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, I have a similar problem, which is not solved by the JSP FAQ...

In our case we are not trying to upload the file, just allow users on our intranet to specify where their file is, and using the Browse button avoids mistypes... it's part of an application where users specify future deployments, and this is part of the documentation they are providing. So we are not (at this stage) interested in the file, only where it is. So, as much as I understand that the primary function of the Browse button is for uploads, Firefox's behaviour is kind of unhelpful.

Any one have any suggestions as to whether Firefox can configured so that the browse button does not have this security feature? Or any Javascript examples that allow a user to select a file.

Thanks for any help

Olly
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I'm afraid that you will have to search for another solution.
 
reply
    Bookmark Topic Watch Topic
  • New Topic