It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes problem with the File upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with the File upload" Watch "problem with the File upload" New topic
Author

problem with the File upload

ramanuja varun
Ranch Hand

Joined: Aug 31, 2007
Posts: 47
I have a problem using the fileupload/browse button. When i am retrieving the field in the spring framework controller it is supposed to render the full path instead it is rendering only the file name which has been uploaded.Can somebody help me out with this. In short i want the full path of the file to be displayed.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not change that. Browsers have done that for "Security" reasons.

Eric
ramanuja varun
Ranch Hand

Joined: Aug 31, 2007
Posts: 47
sir can you let me know is there any way to store the file location. My requirement is to store the location which i have to use to retrieve when ever my file is updated.Please let me know ASAP.
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
I don't know if I understood the requirement right but how about either storing the location path of the file in the database. I have seen projects doing this but even better if all the files are stored in the same location have it in a properties file
ramanuja varun
Ranch Hand

Joined: Aug 31, 2007
Posts: 47
Yes sir i have to take the location of the file from the administrator of the site, store it in the database and retrieve when ever any updates are made. That is if the logo has been changed the admin will just give the location of the new logo. The logo will be updated automatically.
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
Alright, let me try to understand this right. You have a field in the Spring Controller which picks up values from the DB where you have the right path stored.

Are you saying that the db retrieval is not proper or is the field picking up values from some other source.
ramanuja varun
Ranch Hand

Joined: Aug 31, 2007
Posts: 47
I have a Form wherein the admin will enter the location of the logo(image) to be screened using the fileupload/browse .I have to take this real path and store it in the database and retrieve it for later use.I am using spring framework.
[ December 15, 2008: Message edited by: ramanuja varun ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well you are not going to get the path with HTML's file upload control. Look into an applet and see if you can get the path that way.

Eric
bob david
Greenhorn

Joined: Nov 27, 2008
Posts: 4
Hi friend,
You can try applet to upload the file.By browsing the html files available in the applet.


-----------------------------------------------
Big File Upload
" Have a unique feature, like salt. Its presence is not felt but its absence makes things tasteless/useless!"


bob david123
 
 
subject: problem with the File upload