Skip to main content
Question

"Request body ended before we could read expected number of bytes: 33554432

  • May 23, 2025
  • 3 replies
  • 24 views

Forum|alt.badge.img
  1. Hi Team, i am trying to upload part of file in chunks using CURL - i -X PUT "https://upload.box.com/api/2.0/files/upload_sessions/F971964745A5CD0C001BBE4E58196BFD" 
  2. I am getting the response below : 
  3. { code"request_size_mismatch"
  4. message"Request body ended before we could read expected number of bytes: 33554432"
  5. request_id"1ec295d84ce895a2c8afac9296086604" }

 

Also please explain to me how to set this below binary file in http header.

--data-binary @<FILE_NAME>

 

Thanks in Advance.

Rama

3 replies

Forum|alt.badge.img

Hi, 

Can you post the full command you are running? 

Thanks, 

Alex


Forum|alt.badge.img

Hi Alex,

Actually we are implementing the large file uploads in Chunks .

first step is successful using Create upload session API.

Second step is to make the Upload part of file API using -

 curl -X PUT \
  https://upload.box.com/api/2.0/files/upload_sessions/7B724420D5DE54DF249BE2ACBCFD8261\
  -H 'authorization: Bearer 1!htuiKz568eisdwzIjzSIsqsR5EnmHhkCC3YpM1CHRoNdaZAIDK8BqUTiT2j_qdXk3VEzKYv3qSK0I2rHHWVHzLDbwGFK2PuA4ERyVktij9GlPG5HlPshv-AJitYWn1l-Adcx8Dyyp6IGfsKAgCmM2jxzpZ91cSHlfqcd_b5376tZQLHRBz19UUfx4nXFcAY5rL6n6zGIP13XmSkqtCdlWwy0Q_4oVJIsqvbDI2cdIUV9RlszBA5XgHcKiIkyYFwKwymbs6Ia5mAW_vwSvIyAijipa_Buk3skqI18EB9UYdViJbcDxiJtm5-JObVhzOvBpaXsNBAurR-oZndgStaSBlAR0iKrjWGCZiTTVAs6mrUWq2FdRik_Vru1gM8RHafGjpRoYk74wLiAJXHpEA2tvrNPcRebOLOYSEIr1WC_j2MFT-N7AZ7uMoG3EyAEyod4O-PiYtrNYPMxbuKPN2_Z4rULA0GDgIZlUxNcNwrw98iDrQ6vuNJs9-2P4PgYcdXTmDktGh4CmqXO8HYKpW0oSFEaO643EEyNG4OjCjmQ8BWtoM_bsBZGBptVmQ2yE3icI_MT0_jepT3nDw..' \
  -H 'cache-control: no-cache' \
  -H 'content-range: bytes 0-33554431/3896706048' \
  -H 'content-type: application/octet-stream' \
  -H 'digest: sha=vyGp6PvFo4RvsFtPoIWeCReyIC8=' \

After in the Request body we are sending the file object in binary format. 

we got the response like : failed net::ERR_CONNECTION_RESET

I have attached the response in the BOX2_bej8bCM6W5MFjCfe9Pcd7g.pngscreenshot 

I would appreciate your review and suggestions. Thank you very much for your assistance.  

 

Regards

Rama


Forum|alt.badge.img

Is it possible that your company has a proxy or something that is restricting your access to upload/download files? That is typically why I see an error like that.