Skip to content

multipart form#1953

Draft
mamico wants to merge 4 commits intomainfrom
multipart
Draft

multipart form#1953
mamico wants to merge 4 commits intomainfrom
multipart

Conversation

@mamico
Copy link
Copy Markdown
Member

@mamico mamico commented Oct 18, 2025

  • I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
  • I verified there aren't any other open pull requests for the same change.
  • I followed the guidelines in Contributing to Plone.
  • I successfully ran code quality checks on my changes locally.
  • I successfully ran tests on my changes locally.
  • If needed, I added new tests for my changes.
  • If needed, I added documentation for my changes.
  • I included a change log entry in my commits.

If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #1730


📚 Documentation preview 📚: https://plonerestapi--1953.org.readthedocs.build/

@mister-roboto

This comment was marked as resolved.

@mamico
Copy link
Copy Markdown
Member Author

mamico commented Oct 18, 2025

@jenkins-plone-org please run jobs

Copy link
Copy Markdown
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simpler than I expected! Thanks for starting it.

Copy link
Copy Markdown
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this addition. Please see my comment.

Comment on lines +120 to +149
```
POST /++api++/folder1 HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="data"
Content-Type: application/json

{
"@type": "File",
"title": "My file",
"file": {
"data": "attachment_002",
},
"leadimage": {
"data": "attachment_001",
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attachment_001"; filename="profile.jpg"
Content-Type: image/jpeg

[Binary data of the JPEG file]
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="atttachment_02"; filename="docuument.docx"
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document

[Binary data of the Word document]
------WebKitFormBoundary7MA4YWxkTrZu0gW--
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see how to document examples at https://6.docs.plone.org/plone.restapi/docs/source/contributing/index.html#generate-documentation-examples. I'd suggest using the Plone logo for the image (https://6.docs.plone.org/_static/logo.svg) and "Hello, Plone" in a Libre Office file as the binary data.

Comment thread docs/source/usage/serialization.md Outdated
mamico and others added 2 commits October 19, 2025 07:07
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@mamico
Copy link
Copy Markdown
Member Author

mamico commented Nov 15, 2025

Enabling multipart/form-data for PATCH requires zopefoundation/Zope#1274, which fixes the request parsing needed for multipart handling on PATCH requests.

@mamico
Copy link
Copy Markdown
Member Author

mamico commented Feb 9, 2026

@davisagli Because of the Zope fix, the tests are green only on Plone 6.2 (Zope 6) and 5.2 (Zope 4).
We think this feature should target newer Plone versions (and Volto) only, or should we instead ask for a backport to Zope 5?

@davisagli
Copy link
Copy Markdown
Member

@mamico It can be enabled for Plone 6.2 only, as long as it doesn't break other things on older versions.

In that case we should skip the tests on older versions, and be sure to mention in the docs that that feature is version-dependent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

json_body should not read entire request BODY

5 participants