Re: Can a website block the use of file_get_contents ?



Hi,

This site has user agent detection. Change your UA string to a well-
known one:

ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB;
rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');

Then you can download the page.

Regards,

John Peters

On Mar 28, 6:03 am, postseb <post...@xxxxxxxxx> wrote:
Can a website block the use of file_get_contents ?

Example : file_get_contents("http://www.google.com";) works fine, but
file_get_contents("http://www.petitscailloux.com/Follow.aspx?
sUrl=http://www.seloger.com/199986/16271207/detail.htm";) does not.

Any clues or ways to circumvent ?

Thanks a lot !

.



Relevant Pages

  • Re: multi-threaded app/ using lock
    ... I am using multiple child threads per main thread to download files. ... public delegate string ThreadFinishedCallback; ... sFileName = GetNextFileName; ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Internet Table Transfer
    ... URLDownloadToFile is an api function. ... ActiveX component. ... callbacks on the progress of the download. ... Pointer to a string value containing the URL to be downloaded. ...
    (microsoft.public.excel.programming)
  • Re: How to download a file from the internet using inet control
    ... 'Download an URL to a local file without caching. ... Public Function DownloadURL2FileNoCache(ByRef sSourceUrl As String, ... Dim BufferAs Byte ... Dim lNumberOfBytesRead As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Internet download APIs only get first part of file, rest is blank
    ... filling up the rest of the string. ... Code for the download function follows ... ... Private Declare Function InternetCloseHandle Lib "wininet" (ByVal hInet As ...
    (microsoft.public.vb.general.discussion)
  • Question for Randy Birch About Download File
    ... I am using the following code from Randy's site to download some extra files ... DownloadTempRegKey As String 'temporary download destination folder ... Private Declare Function RegQueryValueEx Lib "advapi32.dll" _ ... Dim dldata As FileRegistryDownloadData ...
    (microsoft.public.vb.general.discussion)