incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 7zark7 <7za...@gmail.com>
Subject Re: Attachment serving, directories
Date Sun, 21 Mar 2010 01:56:07 GMT
Yes I'm aware of that, my question is:

"Is there a way to have a unique document per file, which *also* allows
Couch to directly serve web requests for the original directory
structure and file names. (e.g. "/scripts/main.js")"


Thanks


On 3/20/10 6:14 PM, John Merrells wrote:
>
> Write them into couch as a standalone arachment.
>
> John
>
> Sent from my iPhone
>
> On Mar 20, 2010, at 4:44 PM, 7zark7 <7zark7@gmail.com> wrote:
>
>> On 3/20/10 4:30 PM, 7zark7 wrote:
>>> Hi,
>>>
>>> I'd like to use CouchDB for serving static files (images, css, scripts,
>>> etc.)
>>>
>>> The files and directory structure are not under my control, so the files
>>> may be nested under one or more directories. For example:
>>>
>>> /images/a.gif
>>> /images/home/logo.png
>>> /scripts/main.js
>>> /scripts/prototype/prototype.js
>>>
>>> etc.
>>>
>>>
>>> This works fine if I create top-level "directory" documents with ids
>>> such as:
>>> "images",
>>> "scripts",
>>> etc.
>>>
>>> and then upload attachments to these.
>>>
>>> However, I then lose the benefits of a single doc per file, such as
>>> per-file metadata, revision info, etc. The "directory" document revision
>>> also changes each time any attachment is modified. I would like to use
>>> this info to determine what to upload, update, and/or remove from Couch
>>> when the file system changes.
>>>
>>>
>>> Is there a way to have a unique document per file, which *also* allows
>>> Couch to directly serve web requests for the original directory
>>> structure and file names. (e.g. "/scripts/main.js")
>>>
>>> I do not want to have another webapp "in front" of Couch to translate a
>>> request for "/scripts/main.js" into "%2fscripts%2fmain.js/data", or
>>> "/a1b0e2349f53456/scripts/main.js", etc.
>>>
>>>
>>> Thank you for the help.
>>
>>
>> BTW if it's not clear, I am fine with any url prefix (database name,
>> show function URL, etc) for the above paths as I can easily
>> accommodate that.
>>
>> Thanks


Mime
View raw message