adding chunked upload handling

fixes #6007 

@dragotin @PVince81 @rperezb @karlitschek THX