This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
My website is running on Linux. I want to upload images using java code. Can someone please help me how can I do it? If someone can give me code, I will be thankful to him.
Specially I would like to know: I have Windows 2000. When I browse the file to upload how does the Linux will read file from this windows path, say D:\images\myimages.jpg and how this image will be uploaded to some folder in my site that's on linux?
Thanks [ December 14, 2007: Message edited by: Joseph Bashir ]
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35240
7
posted
0
You can use the Commons HttpClient library on the client, and the Commons FileUpload library in a servlet on the server. An article that describes how to use both is linked in http://faq.javaranch.com/java/FileUpload
I have Windows 2000. When I browse the file to upload how does the Linux will read file from this windows path, say D:\images\myimages.jpg and how this image will be uploaded to some folder in my site that's on linux? [/QB]
Linux doesn't read the file system on your client machine. Your browser does.
The browser will send the file to the server. Whatever upload library you use will have a way for you to configure the location for uploaded files. The path information sent with the file (from some browsers) won't affect where the file ends up on your server.