Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the destination of the file

Status
Not open for further replies.

sugarmelo

Programmer
Jul 13, 2008
4
GB
Hello, everyone

I have a common question but i havent manage to solve it.

the last part of my jsp file is:

FileOutputStream fileOut = new FileOutputStream(saveFile);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush();
fileOut.close();

in the FileOutputStream before savefile i have to add the location but how can i achieve this? without the manual way which is
FileOutputStream fileOut = new FileOutputStream("D:\\"+ saveFile);
And first of all i would like the file to go to the folder where the specific jsp file is saved.

Any suggestions??
 
First of all, you should ask this in the Java forum, this one is for JSP specific questions.

Anyway, I don't get the question. Do you know the path where yo want to save the file?

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top