Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom headers on upload and download #59

Closed
mlambley opened this issue Dec 8, 2020 · 1 comment
Closed

Allow custom headers on upload and download #59

mlambley opened this issue Dec 8, 2020 · 1 comment

Comments

@mlambley
Copy link
Member

mlambley commented Dec 8, 2020

Backblaze allows custom headers on upload, such as X-Bz-Info-b2-content-disposition which saves a Content-Disposition on the file, allowing you to have your file stored as one name but download as another.

Likewise, on download they allow the b2ContentDisposition header to override the file name on download.

Given the likelihood that other such headers exist, in the functions upload, download, uploadLargeFile/uploadParts please allow an extra option Headers which merges into the default header values if it exists such as

$response = $this->client->guzzleRequest('POST', $uploadUrl, [
    'headers' => array_merge([
        'Authorization' => $this->authToken,
    ], $options['Headers'] ?? [])
]);

Happy to submit a PR if you wish.

@mlambley
Copy link
Member Author

mlambley commented Feb 3, 2021

Implemented in 1.5.0

@mlambley mlambley closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant