Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

apache upload  RSS feed

 
Irvan Kosini
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys, i need to ask something

i have a jsp page using apache upload for using upload file, but everytime i try upload, it will upload the file to apache bin folder
how to change it ? any idea ?

i have tried edit this but this still cant

fu.setRepositoryPath("/home/irvank/receivefile/");
factory.setRepository(new File("/home/irvank/receivefile/"));
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setRepositoryPath according to the Javadoc is a deprecated method.
It sets the place that files larger than "threshold" will be temporarily stored in.

So this is probably not the right thing for setting where files will be saved to permanently.


What else is in your code?
Presumably you are making a FileOutputStream somewhere? Or declaring a File object for writing to?
If you just have new File("myFile.txt") it will create it in the default directory which is likely going to be the "current" directory - often "bin"

Instead you should either provide a full path for the file, or use the constructor that takes two arguments: new File(directory, fileName)
See java.io.File for details.




 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!