Page MenuHomePhabricator

[mediawiki-api-base] Add ability to set headers on individual multipart parts
Closed, ResolvedPublic

Description

When uploading by chunks, it needs to be possible to set the Content-Disposition header just on the multipart part called chunk.

Could we add a Request::addMultipartParams() (to follow the naming schema of FluentRequest::addParms())?

Then we could do e.g.:

$request->addMultipartParams( [
	'chunk' => [
		'headers' => [
			'Content-Disposition' => 'form-data; name="chunk"; filename="'.$params['filename'] . '"',
		],
	],
] );

Open to better ideas of course!

Current class diagram for reference:

class_diagram.png (867×1 px, 106 KB)

Event Timeline

kaldari subscribed.

Pull request merged.