I meant when I do this: fwrite(fopen('filename','w'),file_get_contents('re mote_file'));
the file get loaded into memory then written into the hard disk
but I solved the problem by using CURLOPT_FILE
thanks anyway