I just posted (
codeplex,
google-code) a new demo app that allows users to upload one or more files (using wildcards) to the SSDS servers. The syntax is pretty simple:
| POST single binary file: |
| /{a}/{c}/{e} "[c:][\folder\path\]file.ext" ["mime-type"] [y] |
| where: |
| {a} = authority |
| {c} = container |
| {e} = entity |
| y = overwrite existing entities |
| |
| ex: /my-auth/files/my-profile "c:\temp\profile.jpg" "image\jpeg" y |
| |
| POST multiple files using wildcard: |
| /{a}/{c}/* "[c:][\folder\path\]*.*" [y] |
| |
| ex: /my-authority/my-container/* "c:\uploads\*.*" y |
| or |
| ex: /my-authority/my-container/* "c:\images\*.png" y |
| |
Currently, SSDS doesn't handle "/" or "\" very well for entity Ids via REST. That means valid entity Ids are "filename.ext", but not "/images/filename.ext." I may do an update that has a work-around for this, but I'm not sure if I'll get to it in the next few days.
NOTE: One of the interesting items in this demo is a method [
GetMimeType(string filename)] that uses the Registry to resolve the selected file's MIME type before sending it on to SSDS. The code is not very complex, but might have some security implications. I'd be curious to hear if anyone has trouble running the code in partial trust.
As usual, looking forward to any feedback.
Mike Amundsen
[http://amundsen.com/blog/]