943,735 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1813
  • Java RSS
Jun 5th, 2009
0

beginner question <<save an image in a folder>>

Expand Post »
I am an absolute beginner in JAVA, i want to know how to upload and save an image in a prescribed folder. sorry, i tried my best to search for this in the net, but i couldn't find any related to this, and also i do not have any sample code. if some one has done a similar task please help me.

i use JBuilder to Build my application..

Please help me i am completely lost in java
Similar Threads
Reputation Points: 1
Solved Threads: 3
Junior Poster
localp is offline Offline
190 posts
since Apr 2008
Jun 5th, 2009
0

Re: beginner question <<save an image in a folder>>

Hi,
For writing a file this is the code snippet
try {
BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
out.write(char[] cbuf, int off, int len);
out.close();
} catch (IOException e) {
}
http://www.exampledepot.com/egs/java...iteToFile.html

Now what do you mean by upload? Is this a client-server setup?
In that case is client/server on JAVA platform, upload is used in HTTP perspective. Please eloborate your requirements.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Sai_Vargheese is offline Offline
3 posts
since Jun 2009
Jun 5th, 2009
0

Re: beginner question <<save an image in a folder>>

Hi,
For writing a file this is the code snippet
try {
BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
out.write(char[] cbuf, int off, int len);
out.close();
} catch (IOException e) {
}
http://www.exampledepot.com/egs/java...iteToFile.html

Now what do you mean by upload? Is this a client-server setup?
In that case is client/server on JAVA platform, upload is used in HTTP perspective. Please eloborate your requirements.

there will be a button call browse when the user clicks on it he will be able to browse through the file system and select a file to upload or save on apache server with is installed on the same PC.

I simply want to Upload an image which is saved on your file system and save it on another location (like in CGI-BIN in apache server)
Reputation Points: 1
Solved Threads: 3
Junior Poster
localp is offline Offline
190 posts
since Apr 2008
Jun 5th, 2009
-1

Re: beginner question <<save an image in a folder>>

For pc to server upload you better to use something like Commons FileUpload
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: updating variable on ouseMoved
Next Thread in Java Forum Timeline: Penny Pitch Game





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC