Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get original file path using MultipartRequest (JSP) ?  RSS feed

 
Aleksandra Semenova
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day,

I'm struggling with the following:
1. I have a form on my JSP to upload the file


2. and some java code that deals with the file:


The problem is this: I need original file location (user selected) - that location will be passed to another application for processing, as those files will be archived after processing.
I've spend a couple hours on google, documentation and trying out all methods available for MultipartRequest, it always gives me a new temporary location on server, which I don't need.
Please, suggest - how do I go around this?
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Original file location? Does that mean the place on the client computer where the file was uploaded from?

If so, then you can't get that. It would be a security violation for the server code to know that sort of information about the client machine. So if somebody designed a system which expects that kind of knowledge, the system is going to have to be rethought.
 
Aleksandra Semenova
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Original file location? Does that mean the place on the client computer where the file was uploaded from?

If so, then you can't get that. It would be a security violation for the server code to know that sort of information about the client machine. So if somebody designed a system which expects that kind of knowledge, the system is going to have to be rethought.


Hi, Yes that means exactly that. Thank for your reply.
But how do I give that information down to java application? I believe - its not a good idea to parse file contents right in the JSP.
 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is supposed to happen to this file?
Why would the processing of the file be a potential problem?
 
Aleksandra Semenova
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:What exactly is supposed to happen to this file?
Why would the processing of the file be a potential problem?


I apologize, my last reply was confusing, but the problem is sorted, I'm giving the application server file location, not local user machine location.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!