King0770-Notes-Bulk Upload To Briefcase: Difference between revisions
No edit summary |
|||
Line 9: | Line 9: | ||
</pre></code> | </pre></code> | ||
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'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.<br> | ||
You should be able to run a for loop to upload files to a user's briefcase:<br> | |||
I had found the following worked for me. | |||
<code><pre> | |||
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 | |||
</pre></code> |
Revision as of 16:11, 13 January 2009
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