File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import retry from "async-retry";
88import ora , { type Ora } from "ora" ;
99import cliSpinners from "npm:cli-spinners" ;
1010import { apiClient } from "../../../apiClient.ts" ;
11+ import { logAndQuit } from "../../../helpers/errors.ts" ;
1112
1213async function readChunk (
1314 filePath : string ,
@@ -94,6 +95,16 @@ const upload = new Command("upload")
9495 const fileInfo = await Deno . stat ( filePath ) ;
9596 const fileSize = fileInfo . size ;
9697
98+ // Check file size limit (128 GiB)
99+ const maxFileSize = 128 * 1024 * 1024 * 1024 ; // 128 GiB in bytes
100+ if ( fileSize > maxFileSize ) {
101+ logAndQuit (
102+ `File size exceeds maximum allowed size of 128 GiB. File size: ${
103+ ( fileSize / ( 1024 * 1024 * 1024 ) ) . toFixed ( 2 )
104+ } GiB`,
105+ ) ;
106+ }
107+
97108 // Calculate parts for progress tracking
98109 const minChunk = 5 * 1024 * 1024 ; // 5 MiB (minimum)
99110 const defaultChunk = 64 * 1024 * 1024 ; // 64 MiB
You can’t perform that action at this time.
0 commit comments