added beforeChunkUpload method