| Check out the Confluence File Uploader or the Confluence WebDAV Plugin instead. |
I tried to create a utility that could upload multiple files in a batch as we have a lot of files that need to go into Confluence. I can see from various discussions that a lot of other users require this as well and it would be nice to have this possible through the remote API.
This is a java swing client that can upload multiple file attachments into Confluence using the Apache Commons HttpClient. It is a bit of a hack and involves logging in to Confluence and establishing an HTTP session then making the right kind of multi-part HTTP POSTS.
| You may also want to check out the Confluence File Uploader which does a similar job! |
There are currently no attachments on this page.

Comments (7)
Mar 22, 2005
Madhusudan GR says:
This would be really neat. Please let me know when you are done with this. We ha...This would be really neat. Please let me know when you are done with this. We have many documents that we would like to upload at one time to the Confluence page. Its tiresome to do it now.
May 09, 2005
Bharat Philiph-Patel says:
A co-worker of mine (Jeff P - who fixed the extra bytes issue) and I have made s...A co-worker of mine (Jeff P - who fixed the extra bytes issue) and I have made some changes (made the UI pretty) to the file and make some UI advancements. Please download the file, unzip to a separate directory, and run the attached batch file. That will launch the UI!
The attached file is cUploadv1.0.zip
Thanks
Bharat
May 10, 2005
Peter Thomas says:
This is awesome, thanks Jeff & Bharat! Can't wait to see the updated code, ...This is awesome, thanks Jeff & Bharat!
Can't wait to see the updated code, I looked for the source in the zip file maybe I missed it - would it be possible for you to attach that also?
Regards,
Peter.
May 11, 2005
Jeff Pierce says:
The change to get the upload working was to remove the extra CRLF that sendEndOf...The change to get the upload working was to remove the extra CRLF that sendEndOfHeader in org.apache.commons.httpclient.methods.multipart.Part class was adding. I have not had a chance to followup with the HttpClient folks to see if this is a possible bug. It could be a bug on the WebWorks side on the receiving end. I believe that is what Confluence uses. I did a short dig into the HTTP spec but didn't come away with an answer.
Another change made was to use the ContentTypeFilePart for each file upload. This class sets the correct MIME type on the file and Confluence handles it better. This is from the org.apache.commons.httpclient.contrib.methods.multipart package.
Jun 27, 2005
Amrit Lalli says:
We were trying to use this tool, and when we tried to upload it had a 404 error ...We were trying to use this tool, and when we tried to upload it had a 404 error (page not found).
When we tried it with a url that was a port 8080 page (localhost:8080), it barfed.
Please let me know. Thanks
Feb 09, 2006
ballico_stretch says:
What paths do you install these file? Failed at: /lib/commons-logging.j...What paths do you install these file?
Failed at:
/lib/commons-logging.jarfile
/lib/commons-httpclient-3.0-rc1.jarfile
/lib/commons-logging.jar
/pluggins/attachments/java/FileUploadClient.java
thanks,
Stretch
Feb 09, 2006
Bob Swift says:
Use the Confluence File uploader instead. See top of page for link.Use the Confluence File uploader instead. See top of page for link.