Skip to content

Commit 2b17d20

Browse files
authored
build: Release (#2941)
2 parents c7b2517 + 52249c2 commit 2b17d20

5 files changed

Lines changed: 44 additions & 4 deletions

File tree

changelogs/CHANGELOG_alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [8.5.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/8.4.0...8.5.0-alpha.1) (2026-03-04)
2+
3+
4+
### Features
5+
6+
* Add `Parse.File` option `maxUploadSize` to override the Parse Server option `maxUploadSize` per file upload ([#2940](https://github.com/parse-community/Parse-SDK-JS/issues/2940)) ([80cab9b](https://github.com/parse-community/Parse-SDK-JS/commit/80cab9b16cf826fa1414bff5f04dbfb7ff18c4d3))
7+
18
# [8.4.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/8.3.0...8.4.0-alpha.1) (2026-03-04)
29

310

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse",
3-
"version": "8.4.0",
3+
"version": "8.5.0-alpha.1",
44
"description": "Parse JavaScript SDK",
55
"homepage": "https://parseplatform.org",
66
"keywords": [

src/ParseFile.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ export type FileSaveOptions = FullOptions & {
1919
metadata?: Record<string, any>;
2020
tags?: Record<string, any>;
2121
directory?: string;
22+
/**
23+
* Overrides the server's `maxUploadSize` for this file upload. Requires the
24+
* master key (`useMasterKey: true`). The value uses the same format as the
25+
* server option (e.g. `'50mb'`, `'1gb'`).
26+
*
27+
* Only supported for Buffer and Stream source types. Files created from
28+
* base64 strings, number arrays, Blobs, or URIs do not support this option.
29+
*
30+
* Requires Parse Server >= 9.5.0.
31+
*/
32+
maxUploadSize?: string;
2233
};
2334
export type FileSource =
2435
| {
@@ -309,6 +320,10 @@ class ParseFile {
309320
* }
310321
* });
311322
* </pre>
323+
* <li>maxUploadSize: Overrides the server's maxUploadSize for this upload.
324+
* Requires the master key. Only supported for Buffer and Stream source
325+
* types; files created from base64 strings, number arrays, Blobs, or URIs
326+
* do not support this option. Requires Parse Server >= 9.5.0.
312327
* </ul>
313328
* @returns {Promise | undefined} Promise that is resolved when the save finishes.
314329
*/
@@ -333,7 +348,7 @@ class ParseFile {
333348
(this._tags && Object.keys(this._tags).length > 0) ||
334349
!!this._directory;
335350

336-
if (controller.saveBinary && (this._source.format === 'stream' || !hasFileData)) {
351+
if (controller.saveBinary && (this._source.format === 'stream' || !hasFileData || options.maxUploadSize)) {
337352
// Binary upload via ajax (file data sent via headers for streams)
338353
this._previousSave = controller
339354
.saveBinary(this._name, this._source, options)
@@ -632,6 +647,9 @@ const DefaultController = {
632647
if (options.tags && Object.keys(options.tags).length > 0) {
633648
headers['X-Parse-File-Tags'] = JSON.stringify(options.tags);
634649
}
650+
if (options.maxUploadSize) {
651+
headers['X-Parse-File-Max-Upload-Size'] = options.maxUploadSize.replace(/[\r\n]/g, '');
652+
}
635653
const jsKey = CoreManager.get('JAVASCRIPT_KEY');
636654
if (jsKey) {
637655
headers['X-Parse-JavaScript-Key'] = jsKey;

types/ParseFile.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ export type FileSaveOptions = FullOptions & {
1010
metadata?: Record<string, any>;
1111
tags?: Record<string, any>;
1212
directory?: string;
13+
/**
14+
* Overrides the server's `maxUploadSize` for this file upload. Requires the
15+
* master key (`useMasterKey: true`). The value uses the same format as the
16+
* server option (e.g. `'50mb'`, `'1gb'`).
17+
*
18+
* Only supported for Buffer and Stream source types. Files created from
19+
* base64 strings, number arrays, Blobs, or URIs do not support this option.
20+
*
21+
* Requires Parse Server >= 9.5.0.
22+
*/
23+
maxUploadSize?: string;
1324
};
1425
export type FileSource = {
1526
format: 'file';
@@ -171,6 +182,10 @@ declare class ParseFile {
171182
* }
172183
* });
173184
* </pre>
185+
* <li>maxUploadSize: Overrides the server's maxUploadSize for this upload.
186+
* Requires the master key. Only supported for Buffer and Stream source
187+
* types; files created from base64 strings, number arrays, Blobs, or URIs
188+
* do not support this option. Requires Parse Server >= 9.5.0.
174189
* </ul>
175190
* @returns {Promise | undefined} Promise that is resolved when the save finishes.
176191
*/

0 commit comments

Comments
 (0)