File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes uploading a file programmatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "uploading a file programmatically" Watch "uploading a file programmatically" New topic

uploading a file programmatically

Gayatri Sinha
Ranch Hand

Joined: Feb 13, 2006
Posts: 34

we need to upload a file to a website regularly. This website has a login, password and then a button to browse the file and a upload button to upload the file.

Have been doing this manually till now, is it possible have a program that could upload the file to the website?

- Gayatri
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
You could use HttpUnit (on SourceForge) to navigate through the login, and then use Jakarta Commons HttpClient to do the file upload.
Adam Richards
Ranch Hand

Joined: Nov 03, 2005
Posts: 135
Or, if the Web site has an FTP server running, use the Jakarta Commons FTP client class.
I agree. Here's the link:
subject: uploading a file programmatically
It's not a secret anymore!