change file transfer method to chunk by chunk