CouchDB
  1. CouchDB
  2. COUCHDB-715

Ability to rename _attachment filenames

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Database Core
    • Labels:
      None
    • Skill Level:
      New Contributors Level (Easy)

      Description

      Would be nice if the filename can be renamed, not just in futon alone but also via the API

        Activity

        Arthur Bits created issue -
        Hide
        Robert Newson added a comment -

        Proposed API is;

        Request;

        MOVE /db/doc/old.jpg HTTP/1.1
        Destination: /db/doc/new.jpg

        Response;

        HTTP/1.1 201 Created
        Location: <new url>

        Show
        Robert Newson added a comment - Proposed API is; Request; MOVE /db/doc/old.jpg HTTP/1.1 Destination: /db/doc/new.jpg Response; HTTP/1.1 201 Created Location: <new url>
        Hide
        Robert Newson added a comment -

        and 403 for attempts to move attachments between documents.

        Show
        Robert Newson added a comment - and 403 for attempts to move attachments between documents.
        Hide
        Robert Newson added a comment -

        Basic patch to rename attachments.

        1) No tests yet
        2) Does not return 403 when attempting cross-document rename
        3) Probably other bugs too

        Use as follows;

        curl -v http://localhost:5984/db/doc/old_name?rev=foo -X MOVE -H "Destination: new_name"

        Show
        Robert Newson added a comment - Basic patch to rename attachments. 1) No tests yet 2) Does not return 403 when attempting cross-document rename 3) Probably other bugs too Use as follows; curl -v http://localhost:5984/db/doc/old_name?rev=foo -X MOVE -H "Destination: new_name"
        Robert Newson made changes -
        Field Original Value New Value
        Attachment 0001-rename-attachment.patch [ 12440194 ]
        Robert Newson made changes -
        Skill Level New Contributors Level (Easy)
        Hide
        Jan Lehnardt added a comment -

        Looks good to me: a bunch of JS tests and the 403 response and this is ready to go in

        Show
        Jan Lehnardt added a comment - Looks good to me: a bunch of JS tests and the 403 response and this is ready to go in
        Hide
        Nathan Vander Wilt added a comment -

        Being able to edit attachment names and content-type via PUT'ing the document stubs would be great, as per this discussion: http://stackoverflow.com/questions/7145157/trouble-with-getting-a-couchapp-to-output-the-correct-mime-type-for-an-appcache#comment8578562_7148071

        Perhaps that's a separate ticket though?

        Show
        Nathan Vander Wilt added a comment - Being able to edit attachment names and content-type via PUT'ing the document stubs would be great, as per this discussion: http://stackoverflow.com/questions/7145157/trouble-with-getting-a-couchapp-to-output-the-correct-mime-type-for-an-appcache#comment8578562_7148071 Perhaps that's a separate ticket though?

          People

          • Assignee:
            Unassigned
            Reporter:
            Arthur Bits
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development