I have small issue with php file_get_contents();
i try to download compressed packages from url like "http://mydomain.com?download.php?id=1234"
downloading same file with browser works and all headers seems to be ok but through file_get_contents file is empty...
views:
74answers:
2
+1
A:
Don't you mean that it return false ?
Anyway if you're download files, it would be better to use the curl library and the HTTP extension.
Resources :
Colin Hebert
2010-09-16 18:39:23
+1 for Curl, Curl should be what you are looking for.
jostster
2010-09-16 20:31:02
A:
different host and mimetype returns empty so i can't hadle those packages.
- just installed http and got more information about link and yes it is redirected so is file_get_contents only way to go or does curl support redirection?
Got it
Found script from http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/ which got me through with redirect link issue so now i got good script to fetch data.
Thank you all
Eagle
2010-09-16 19:25:53