Correctly handle the upload path during them import/export

See #7466