Skip to content

multipart form#1953

Open
mamico wants to merge 7 commits into
mainfrom
multipart
Open

multipart form#1953
mamico wants to merge 7 commits into
mainfrom
multipart

Conversation

@mamico

@mamico mamico commented Oct 18, 2025

Copy link
Copy Markdown
Member
  • 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

mamico commented Oct 18, 2025

Copy link
Copy Markdown
Member Author

@jenkins-plone-org please run jobs

@davisagli davisagli left a comment

Copy link
Copy Markdown
Member

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.

@stevepiercy stevepiercy left a comment

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.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

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

mamico commented Nov 15, 2025

Copy link
Copy Markdown
Member Author

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

@mamico

mamico commented Feb 9, 2026

Copy link
Copy Markdown
Member Author

@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.

@read-the-docs-community

read-the-docs-community Bot commented Jun 14, 2026

Copy link
Copy Markdown

Documentation build overview

📚 plone.restapi | 🛠️ Build #33136285 | 📁 Comparing a96d62d against latest (0a96a45)

  🔍 Preview build  

1 file changed
± usage/serialization.html

@mamico mamico marked this pull request as ready for review June 14, 2026 20:27
@mamico

mamico commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

@jenkins-plone-org please run jobs

@mamico mamico requested review from davisagli and stevepiercy June 14, 2026 20:27
@mamico

mamico commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

Here a PoC for Volto 19.x https://github.com/collective/volto-multipart-upload/

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