write downloaded media to tmpdir