This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes input file element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "input file element " Watch "input file element " New topic
Author

input file element

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
HI ,
on my jsp i have file element, when i select a file it shows me whole path of selected file in the input box but when i see that value using alert it shows me only name of this file , why so ?

my problem is i have included 2 jsps in one jsp , on first jsp i am selecting file but not submitting the form ,then i click on second command which opens second jsp closing first jsp ,when i closes 2nd jsp i need to open first jsp on close event of second jsp with selected file in the input box , how can i retain this value of file



Waiting for answer

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

You can't. For security purposes, the file path is not included.

By the way, please avoid posting phrases such as
Waiting for answer
as it's just annoying. It's obvious that you are waiting for an answer.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
ok can't i set default value for file element i am reading it on google its again saying 'SECURITY REASONS' is there alternative for this ...i am really worried now
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

No, there is no alternative.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: input file element
 
Similar Threads
Drop down Value and Submit
Column Tabbing issue in DataTable
How do I populate dynamic combox items
Dropdown values for JSP
I want to fill a Listbox with values dynamically using JSP when I press a button