boon Posted December 14, 2005 Report Share Posted December 14, 2005 Ir nepieciešamība lai php nopumee failu mani noteiktajaa diraa nu piem lai php panjem failu no http://guncha.lv/Files/Guncha_Tik_Dikti_Vajag.mp3 un ieliek mansurlis/files Paldies par atsaucību! Link to comment Share on other sites More sharing options...
[Ya] Posted December 14, 2005 Report Share Posted December 14, 2005 $data=file_get_contents($url); $f=fopen($filename,"w"); fwrite($f,$data); fclose($f); Link to comment Share on other sites More sharing options...
boon Posted December 14, 2005 Author Report Share Posted December 14, 2005 (edited) Hosts nenjema bet tik un ta Paldies! Edited December 14, 2005 by boon Link to comment Share on other sites More sharing options...
php_Stopp Posted December 14, 2005 Report Share Posted December 14, 2005 man drīzāk liekas, ka nevis w, bet x pie fopen jālieto.. ja grib to failu iekopēt kā jaunu failu ar paša izvēlētu nosaukumu. bet nu jebkurā gadījumā vienkāršāks veids - http://php.net/copy/ Link to comment Share on other sites More sharing options...
[Ya] Posted December 14, 2005 Report Share Posted December 14, 2005 no lv.php.net 'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. 'x' Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files. taatad ja kautkas zem taa faila ir tad vinjsh rakstiis pa virsu!! ja lieto "w" ja "x" tad buus errors .... tapeec skatoties kaadaam vajadziibaam kaa lietosim ... Link to comment Share on other sites More sharing options...
php_Stopp Posted December 14, 2005 Report Share Posted December 14, 2005 ja fails neeksistē, tad ar w mēģinot atvērt failu, viņš uztaisa to failu, bet izmet error paziņojumu, ka faila nav.. mošk ar @ priekšā to erroru var noņemt, bet nu var jau arī pārbaudīt, vai eksistē vai nē.. Link to comment Share on other sites More sharing options...
[Ya] Posted December 14, 2005 Report Share Posted December 14, 2005 kā teikt tā ir gaumes lieta ;) katrs dara kā viņam ērtāk un kā viņš uzskata par pareizu :) Link to comment Share on other sites More sharing options...
Recommended Posts