You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Tom Robinson (JIRA)" <ji...@apache.org> on 2008/12/02 13:38:44 UTC

[jira] Commented: (COUCHDB-167) Files can not be attached to documents with forward slashes in their names to simulate a folder hierarchy

    [ https://issues.apache.org/jira/browse/COUCHDB-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652350#action_12652350 ] 

Tom Robinson commented on COUCHDB-167:
--------------------------------------

When I used Futon to add the attachment it used a colon instead of a forward slash, so I could access the image at http://localhost:5984/test/_design%2Fnested/images%3Apickle.gif (%3A is a colon)

You can use "%2F" in place of a forward slash, in which case it shows up as a forward slash in Futon, but actually requires "%2F" in the URL.

If you *actually* try to save an attachment with a forward slash in it the request actually crashes. For example, this:

    curl -v -H "Content-Type: image/gif" -T ~/pickle.gif http://localhost:5984/test/_design%2Fnested/images/pickle.gif?rev=3329617083

causes this error:


[error] [<0.290.0>] {error_report,<0.22.0>,
    {<0.290.0>,crash_report,
     [[{pid,<0.290.0>},
       {registered_name,[]},
       {error_info,
           {error,function_clause,
               [{couch_httpd_db,db_req,
                    [{httpd,
                         {mochiweb_request,#Port<0.1604>,'PUT',
                             "/test/_design%2Fnested/images/pickle.gif?rev=3329617083",
                             {1,1},
                             {6,
                              {"user-agent",
                               {'User-Agent',
                                   "curl/7.19.2 (i386-apple-darwin9.5.0) libcurl/7.19.2 zlib/1.2.3"},
                               {"host",
                                {'Host',"localhost:5984"},
                                {"accept",
                                 {'Accept',"*/*"},
                                 nil,
                                 {"content-type",
                                  {'Content-Type',"image/gif"},
                                  {"content-length",
                                   {'Content-Length',"806152"},
                                   nil,nil},
                                  {"expect",
                                   {"Expect","100-continue"},
                                   nil,nil}}},
                                nil},
                               nil}}},
                         'PUT',
                         [<<"test">>,<<"_design/nested">>,<<"images">>,
                          <<"pickle.gif">>],
                         {dict,2,16,16,8,80,48,
                             {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
                             {{[],[],[],[],[],[],[],[],[],[],[],
                               [[<<"_temp_view">>|
                                 #Fun<couch_httpd.7.18882544>]],
                               [],
                               [[<<"_view">>|#Fun<couch_httpd.7.18882544>]],
                               [],[]}}},
                         {user_ctx,nil,[<<"_admin">>]}},
                     {db,<0.122.0>,<0.123.0>,nil,<0.121.0>,
                         {db_header,0,11,
                             {4833,9263},
                             {1891797,{4,0}},
                             {1891616,4},
                             nil,0,nil,nil},
                         {stream,<0.124.0>,<0.121.0>},
                         {btree,<0.121.0>,
                             {1891797,{4,0}},
                             #Fun<couch_db_updater.6.124665223>,
                             #Fun<couch_db_updater.7.45786599>,
                             #Fun<couch_db_updater.5.74731249>,
                             #Fun<couch_db_updater.8.118159480>},
                         {btree,<0.121.0>,
                             {1891616,4},
                             #Fun<couch_db_updater.9.48828661>,
                             #Fun<couch_db_updater.10.81431945>,
                             #Fun<couch_btree.5.112258129>,
                             #Fun<couch_db_updater.11.102742899>},
                         {btree,<0.121.0>,nil,#Fun<couch_btree.0.23070627>,
                             #Fun<couch_btree.1.117278773>,
                             #Fun<couch_btree.2.112258129>,nil},
                         11,<<"test">>,
                         "/usr/local/var/lib/couchdb/test.couch",[],[],nil,
                         {user_ctx,nil,[<<"_admin">>]}}]},
                {couch_httpd_db,do_db_req,2},
                {couch_httpd,handle_request,3},
                {mochiweb_http,headers,4},
                {proc_lib,init_p_do_apply,3}]}},
       {initial_call,{mochiweb_socket_server,acceptor_loop,['Argument__1']}},
       {ancestors,
           [couch_httpd,couch_secondary_services,couch_server_sup,<0.1.0>]},
       {messages,[]},
       {links,[<0.56.0>,#Port<0.1604>]},
       {dictionary,[]},
       {trap_exit,false},
       {status,running},
       {heap_size,987},
       {stack_size,23},
       {reductions,1446}],
      []]}}
[error] [<0.56.0>] {error_report,<0.22.0>,
              {<0.56.0>,std_error,
               {mochiweb_socket_server,235,{child_error,function_clause}}}}

=ERROR REPORT==== 2-Dec-2008::04:34:56 ===
{mochiweb_socket_server,235,{child_error,function_clause}}



> Files can not be attached to documents with forward slashes in their names to simulate a folder hierarchy
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-167
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-167
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 0.9
>         Environment: Mac OS X 10.5.5, MacBook Pro, CouchDB 0.9.0a721757-incubating 
>            Reporter: Justin Walgran
>
> Steps to reproduce:
> 1) Download sample files from http://walgran.com/justin/CouchDB-nested-attachment-sample.zip
> 2) Unzip CouchDB-nested-attachment-sample.zip
> 3) Create a new CouchDB database
> 4) Create a new document called "_design/nested"
> 5) Add "index.html," "pickle.gif" and "images/pickle.gif" as attachments to the document
> 6) Browse the  index.html attachment
> Expected Behavior:
> Browsing index.html shows two copies of pickle.gif on the page
> Error:
> The second image fails to load. 
> Notes:
> Damien suggested using directory separators within file names to simulate folder hierarchies in a November 28th response to the  couchdb-user@incubator.apache.org mailing list.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.