King0770-Notes-Bulk Upload To Briefcase

Revision as of 16:13, 13 January 2009 by King0770 (talk | contribs)

Description: This wiki will hopefully answer the question, "How do upload a bunch of files to a user's briefcase?"

From a remote machine

If you wish to upload files from a remote server to the Zimbra server, you could use curl to upload.

Here's an example of uploading a single file:

curl -u zimbra_user:zimbra_user_password --data-binary "@/mp3/Let it be.mp3" http://zimbra.domain.com/service/home/zimbra_user/Briefcase/Let_it_be.mp3

You'll note I've put double quotes around "@/mp3/Let it be.mp3", because the file name contains spaces. I tried putting double quotes around the Zimbra address with a file that had spaces, but it didn't seem to work for me. The only way to upload was successful, was to put underscores in the filename. Perhaps curl doesn't like file names with spaces.

You should be able to run a for loop to upload files to a user's briefcase:
I had found the following worked for me.

for i in `ll | awk '{ print $9 }'`; do curl -u zimbra_user:zimbra_user_password --data-binary "@/docs/$i" http://zimbra.domain.com/service/home/zimbra_user/Briefcase/$i; done

If you had already worked out the "files with spaces" issues, this command should be sufficient.

Jump to: navigation, search