Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass the file path dynamically from jsp to servelet dynamically  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a file uploader to choose the file and i need to pass that file path to my servlet dynamically instead of giving the file path statically how can i do this.Below is my jsp code

<label for="fileName">Select File: </label>
            <input id="fileName" type="file" name="fileName" size="30"/> <br/>
<input type="submit" value="Upload"/>    

Below  is my servlet code where i am passing the path statically how can i pass dynamically

File file = new File("C:Desktop\\test.ods");
            Upload objODSReader = new Upload();
            objODSReader.readODS(file);
 
Ranch Hand
Posts: 62
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need path? why do you need client file path on server?
you submit your request you will be having file content on server along with file name, now its upto you to what path you want to save it.
 
I am going to test your electrical conductivity with this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!