fixes chunked upload 


fixes #5367

@ogoffart Can I ask you to retest this? THX