You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Benjamin Young (JIRA)" <ji...@apache.org> on 2016/04/29 17:00:16 UTC

[jira] [Commented] (COUCHDB-1705) Update Function does not parse multipart/form-data

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

Benjamin Young commented on COUCHDB-1705:
-----------------------------------------

{{multipart/form-data}} is not that dissimilar to {{multipart/related}} which CouchDB can handle for PUT requests.

The format follows this pattern:

```
--xYzZY
Content-Disposition: form-data; name=\"name\"

BigBlueHat
--xYzZY
Content-Disposition: form-data; name=\"website\"

http://bigbluehat.com/
--xYzZY
Content-Disposition: form-data; name=\"photo\"
Content-Type: image/png

...insert binary photo...
```

The {{Content-Type}} defaults to {{text/plain}} otherwise.

More useful info here: http://tools.ietf.org/html/rfc1867#section-7

> Update Function does not parse multipart/form-data
> --------------------------------------------------
>
>                 Key: COUCHDB-1705
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1705
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 1.2.1, 1.6.1
>            Reporter: Anthony Ananich
>         Attachments: base64.patch, base64_fixed.patch
>
>
> I have a design doc and update handler.
> {quote}
> function(doc, req) {
>     log(req);
>     var newdoc = {};
>     ...
>     return [newdoc, \{
>     	code: 200,
>     	body: req.uuid
>         }];
> }
> {quote}
> I made a HTML file with the following form
> {quote}
> <form action="http://localhost:5984/db/_design/app/_update/crashreport" method="POST" enctype="multipart/form-data">
> <input type="text" name="classname"/><br>
> <input type="Submit">
> </form>
> {quote}
> In the log file I can see that POST request body exists, but was not parsed:
> {quote}
> { "body" : "------WebKitFormBoundaryE6xRBni3g8MNw14P\r\nContent-Disposition: form-data; name=\"classname\"\r\n\r\nABC\r\n------WebKitFormBoundaryE6xRBni3g8MNw14P--\r\n",
>   "form" : {  },
> ...
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)