fix upload error when file is larger then 8192 bytes

fixed an error that caused uploads to s3 to fail when the files is larger than the BufferSize (8192).