[chandler-users] Re: Accessing home collection over webdav

Brian Moseley bcm at osafoundation.org
Mon Dec 3 09:00:03 PST 2007


On Dec 3, 2007 7:37 AM, BALATON Zoltan <balaton at eik.bme.hu> wrote:

> Yes, you were guessing right, I was trying to use Finder. Now I tried
> cadaver instead but I still cannot upload random files to a collection. In
> the server logs I see:
>
> INFO  [StandardRequestHandler] Client error (400): No media type specified

cadaver unfortunately does not provide a Content-Type header, which
Cosmo requires in order to accept the uploaded file.

try using curl:

curl -T <path to local file> -H 'Content-Type: text/plain'
http://host:port/chandler/dav/{username}/{collection name}/

this should cause the file to be stored inside the collection under
the same name as the local file.

(i believe -T assumes the method is PUT ... if not, try adding -X PUT)

> Is uploading any files such as documents into collections and sharing them
> supposed to work or am I trying to do something that is not meant to be
> done?

the sharing of arbitrary files is supposed to work, but it is not the
primary focus of Cosmo.

that said, we can do a couple quick things to beef up the server's
handling of uploads without Content-Type headers

1) attempt to guess the media type of an uploaded file by examining
its file extension, and
2) default to something like 'application/octet-stream'

Cosmo did in fact have this behavior a long time ago, but I guess it
got lost in the shuffle during an extensive refactoring we performed a
few months back.

one other note: collections created through the Cosmo web UI are, from
the WebDAV/CalDAV perspective, calendar collections. this means that
only resources of type text/calendar can be uploaded into these
collections. this is by design. if you want a non-calendar collection
in which you can store arbitrary files, you can either

1) use your home collection, or
2) use cadaver or another dav client to MKCOL a regular collection


More information about the chandler-users mailing list