Change to use full allocated buffer for file transfer