File tree Expand file tree Collapse file tree 3 files changed +12
-17
lines changed
Expand file tree Collapse file tree 3 files changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -106,10 +106,10 @@ export function MediaPicker({
106106 return ;
107107 }
108108
109- const maxSize = 50 * 1024 * 1024 ;
110- if ( file . size > maxSize ) {
109+ const maxCloudUploadSize = 50 * 1024 * 1024 ;
110+ if ( isCloudConnected && file . size > maxCloudUploadSize ) {
111111 console . error (
112- `handleFileUpload: File size exceeds maximum of ${ maxSize / ( 1024 * 1024 ) } MB`
112+ `handleFileUpload: File size exceeds maximum of ${ maxCloudUploadSize / ( 1024 * 1024 ) } MB while connected to cloud `
113113 ) ;
114114 return ;
115115 }
Original file line number Diff line number Diff line change @@ -263,13 +263,6 @@ export function useVideoSource(props?: UseVideoSourceProps) {
263263
264264 const handleVideoFileUpload = useCallback (
265265 async ( file : File ) => {
266- // Validate file size (10MB limit)
267- const maxSize = 10 * 1024 * 1024 ; // 10MB in bytes
268- if ( file . size > maxSize ) {
269- setError ( "File size must be less than 10MB" ) ;
270- return false ;
271- }
272-
273266 // Validate file type
274267 if ( ! file . type . startsWith ( "video/" ) ) {
275268 setError ( "Please select a video file" ) ;
Original file line number Diff line number Diff line change @@ -1570,13 +1570,15 @@ async def upload_asset(
15701570 # Read file content from request body
15711571 content = await request .body ()
15721572
1573- # Validate file size (50MB limit)
1574- max_size = 50 * 1024 * 1024 # 50MB
1575- if len (content ) > max_size :
1576- raise HTTPException (
1577- status_code = 400 ,
1578- detail = f"File size exceeds maximum of { max_size / (1024 * 1024 ):.0f} MB" ,
1579- )
1573+ # Apply upload size validation only for cloud uploads.
1574+ # Local mode keeps files on the same machine, so no explicit cap is enforced.
1575+ if cloud_manager .is_connected :
1576+ max_size = 50 * 1024 * 1024 # 50MB
1577+ if len (content ) > max_size :
1578+ raise HTTPException (
1579+ status_code = 400 ,
1580+ detail = f"File size exceeds maximum of { max_size / (1024 * 1024 ):.0f} MB" ,
1581+ )
15801582
15811583 # If cloud mode is active, upload to cloud AND save locally for thumbnails
15821584 if cloud_manager .is_connected :
You can’t perform that action at this time.
0 commit comments