Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0, 3.6.1
    • None
    • None

    Description

      Why?

      User want to upload file/files for an account.
      How?

      Request
      To upload a file, the client submits an authenticated POST request to the file upload resource - which MUST contain a variable called accountId.
      Sample: "https://jmap.example.com/upload/{accountId}"

      Response
      A successful request MUST return a single JSON object with the following properties as the response:

      *accountId*: Id The id of the account used for the call.
      
      *blobId*: Id The id representing the binary data uploaded. The data for this id is immutable. The id only refers to the binary data, not any metadata.
      
      *type*: String The media type of the file (as specified in [@!RFC6838], Section 4.2) as set in the Content-Type header of the upload HTTP request.
      
      *size*: UnsignedInt The size of the file in octets.
      

      Note

      If identical binary content to an existing blob in the account is uploaded, the existing blobId MAY be returned.
      Clients should use the blobId returned in a timely manner. Under rare circumstances, the server may have deleted the blob before the client uses it; the client should keep a reference to the local file so it can upload it again in such a situation.
      When an HTTP error response is returned to the client, the server SHOULD return a JSON “problem details” object as the response body, as per [@!RFC7807].
      As access controls are often determined by the object holding the reference to a blob, unreferenced blobs MUST only be accessible to the uploader, even in shared accounts.

      Definition of done

      When bob uploads an attachment
       Then an upload response is sent to him
       And using the blobId specified in the upload response, bob can download that attachment
      

      Write integration tests for it.

      Attachments

        Activity

          People

            btellier Benoit Tellier
            ducnv Nguyễn Việt Đức
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: