I would go with your initial idea instead and use a separate connection for the file transfer.

Cheers,
_