fopen and download URL functional