PHPackages                             goetas/multipart-upload-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. goetas/multipart-upload-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

goetas/multipart-upload-bundle
==============================

Goetas MultipartUploadBundle

1.5.0(2y ago)2121.3k↓37%5[1 issues](https://github.com/goetas/MultipartUploadBundle/issues)MITPHPPHP ^8.0

Since Dec 27Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/goetas/MultipartUploadBundle)[ Packagist](https://packagist.org/packages/goetas/multipart-upload-bundle)[ RSS](/packages/goetas-multipart-upload-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (11)Used By (0)

GoetasMultipartUploadBundle
===========================

[](#goetasmultipartuploadbundle)

[![Build Status](https://camo.githubusercontent.com/3e0109675d82b318d9f1aa895cfe0c27cc4b817f94a659f2508e74f0029e3ec2/68747470733a2f2f7472617669732d63692e6f72672f676f657461732f4d756c74697061727455706c6f616442756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/goetas/MultipartUploadBundle)[![Latest Stable Version](https://camo.githubusercontent.com/4dd9d80bc3fc46c68fdccc9acae7bb11b3b6997b08c7bf7784c2cf85ade9a616/68747470733a2f2f706f7365722e707567782e6f72672f676f657461732f6d756c7469706172742d75706c6f61642d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/goetas/multipart-upload-bundle)[![Code Coverage](https://camo.githubusercontent.com/eeb4109ff88fadda79f9476a2c937b89b81eb2e19d06e13752809b12a4e93e2e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f657461732f4d756c74697061727455706c6f616442756e646c652f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/goetas/MultipartUploadBundle/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b1b07735efe4ae37127c461b6db9e6967c35248b92458c314569128d52d7bd8a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f657461732f4d756c74697061727455706c6f616442756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/goetas/MultipartUploadBundle/?branch=master)

Symfony `multipart/related`, `multipart/alternative` and `multipart/mixed` content type handler.

This bundle implements a subset of the [https://www.w3.org/Protocols/rfc1341/7\_2\_Multipart.html](https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html) specifications and allows you to deal with `Content-Type: multipart/*;` requests with Symfony.

Install
-------

[](#install)

Run `composer require goetas/multipart-upload-bundle`

Add bundle to symfony (if not using symfony/flex)

Request format
--------------

[](#request-format)

A `multipart/related` request could look like this:

```
Host: localhost
Content-Type: multipart/related; boundary=19D523FB

--19D523FB
Content-Type: application/json

{
    "content": "Some JSON content"
}
--19D523FB
Content-Type: image/png
Content-Disposition: form-data; name="image"; filename="image.jpg"
Content-MD5: 314ca078416a9b27efbe338ac5a2f727

... binary content...
Content-Type: text/html
Content-Disposition: form-data; name="content"
Content-MD5: 314ca078416a9b27efbe338ac5a2f727

HTML content

--19D523FB
Content-Type: image/png
Content-Disposition: attachment; filename="image.jpg"
Content-MD5: 314ca078416a9b27efbe338ac5a2f727

... binary content...

--19D523FB
Content-Type: octet/stream
X-Custom-Header: header value

... binary content...

--19D523FB--

```

Usage
-----

[](#usage)

### Controller

[](#controller)

Body will not be decoded automatically, you can decode it by yourself or use [FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle) to handle it transparently

```
public function indexAction(Request $request)
{
    if ('application/json' == $request->headers->get('content-type')) {
        $data = json_decode($request->getContent(), true);
    }
}
```

### Form Fields

[](#form-fields)

Parts with `form-data; name=` in `Content-Disposition` part's headers will be treated like an regular uploaded file.

```
$html = $request->request->get('content');
```

Can be used with Symfony's form builder

```
$builder->add('content', TextAreaType::class);
```

### Uploaded Files

[](#uploaded-files)

Parts with `form-data; name=` and `filename=` in `Content-Disposition` part's headers will be treated like an regular uploaded file.

```
$file = $request->files->get('image');
```

Can be used with Symfony's form builder

```
$builder->add('image', FileType::class);
```

### Attachment Files

[](#attachment-files)

Parts with `attachment; filename=` in `Content-Disposition` part's headers will be treated as an attachment file.

```
$attachment = $request->attributes->get('attachments')[0];
```

### Related Parts

[](#related-parts)

Parts without a `filename` will be treated as `Riverline\MultiPartParser\StreamedPart` object. Will be possible to access as well all the parts trough the `related-parts` attribute.

```
$part = $request->attributes->get('related-parts')[0];
```

- Get part's headers

```
$headers = $part->getHeaders()->all();
```

- Get part's content

```
$content = $part->getContent();
```

- Get part's content as resource

```
$content = stream_get_contents($part->getContent(true));
```

- First part injected

By default, when a message is `multipart/*`, the first part will become the Symfony message content. You can disable this by setting `first_part_as_default` to `false`.

```
$content = $request->getContent(); // content of the first part, not the whole message
```

Configurations
--------------

[](#configurations)

```
goetas_multipart_upload:
  first_part_as_default: true
```

Note
----

[](#note)

The code in this project is provided under the [MIT](https://opensource.org/licenses/MIT) license. For professional support contact or visit

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance54

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 66.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~207 days

Total

10

Last Release

832d ago

PHP version history (3 changes)1.0.0PHP ^7.0

1.1.0PHP ^7.1|^8.0

1.4.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/776743?v=4)[Asmir Mustafic](/maintainers/goetas)[@goetas](https://github.com/goetas)

---

Top Contributors

[![goetas](https://avatars.githubusercontent.com/u/776743?v=4)](https://github.com/goetas "goetas (57 commits)")[![bigfoot90](https://avatars.githubusercontent.com/u/4598274?v=4)](https://github.com/bigfoot90 "bigfoot90 (15 commits)")[![Guite](https://avatars.githubusercontent.com/u/277531?v=4)](https://github.com/Guite "Guite (10 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (2 commits)")[![kunicmarko20](https://avatars.githubusercontent.com/u/13528674?v=4)](https://github.com/kunicmarko20 "kunicmarko20 (1 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1 commits)")

---

Tags

httpmultipart-uploadsphpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/goetas-multipart-upload-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/goetas-multipart-upload-bundle/health.svg)](https://phpackages.com/packages/goetas-multipart-upload-bundle)
```

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k48.1M236](/packages/api-platform-core)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[friendsofsymfony/http-cache-bundle

Set path based HTTP cache headers and send invalidation requests to your HTTP cache

43813.2M47](/packages/friendsofsymfony-http-cache-bundle)[illuminate/http

The Illuminate Http package.

11936.0M5.1k](/packages/illuminate-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
