This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get the path of an Uploaded file?

 
Aashu Mahajan
Ranch Hand
Posts: 114
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i want to know how to get the path of an uploaded file.
I am uploading the file in a JSP Page (using HTML tags and i am not using multipart...) and the request.getParameter() for that file is in another JSP page. How do i get the path of the file uploaded. Please help me

-Ashish Mahajan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64856
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot upload a file without using a multipart request. And regardless, you cannot get the original path of the file except under IE which has a security bug that lets you see the path.
 
Aashu Mahajan
Ranch Hand
Posts: 114
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there no any alternative way to get the path??
Actually i want to get the path of an image file that is uploaded and want to copy that uploaded image file to a specific folder. so how should i do that when i can't get the full path of an uploaded file?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64856
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What path are you asking about? The original path on the client or the path of the file after upload on the server? You can't get the former, the latter is wherever your code writes the file.
 
Miku Ranjan
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Use javascript to set the file path to another hidden input in that form before submit the form.
 
Aashu Mahajan
Ranch Hand
Posts: 114
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok and can i uplaod, save and retrive image from the server?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic