flush output buffer before sending file