Skip to main content
Question

Upload file without knowing file size

  • May 22, 2025
  • 3 replies
  • 2 views

Forum|alt.badge.img

Hello

I am working on app that is supposed to upload a files to the box platform. 

Since I am receiving the data from other program in chunks I don`t know the size of the final file. 

In all examples that I found I need to pass a file size before start sending the chunks.

 

Is there a way to upload a file without knowing the size?

 

3 replies

Forum|alt.badge.img

Hi ,

 

Uploading small files can be done with the upload file endpoint, which doesn't require a size to be added.

 

Of course, since you're getting the file sent in chunks then it is most likely a large file, which you would need the chunked upload option for - this requires a size. The best practice here is to capture all chunks from the 3rd party, put it together into the original file, then upload to Box. You'll have knowledge of the file size once reassembled. 

 

- Jon 


Forum|alt.badge.img

Hi  

 

Thanks for your answer.

Unfortunately this will be a problem, I am not sure if my app will have access to the filesystem or enough memory to collect all chunks before start sending them to box. So I need to look for some other approach if possible.

 

I will probably work with large video files in most cases over few GBs

 

Is there a way to append data to existing box file?

1) Upload 1MB file

2) Open same file and add 10MB to end up with 11MB file on the box?

 

BTW I am using "Custom app" from box side for integration

 

Thanks

 

 

 

 


Forum|alt.badge.img

Unfortunately not , chunked upload will require you to have a completed file before upload starts, meaning you can't upload one part, then add another at a later time. This is because the uploader will need to verify that the parts are put together based off of the file metadata that is supplied from you start uploading.