Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Problems with copying a file from the Internet.


From   Guo Xu <[email protected]>
To   [email protected]
Subject   Re: st: Problems with copying a file from the Internet.
Date   Mon, 12 Sep 2011 11:55:22 +0100

I assume the server throws a HTTP 302 redirection when it cannot
identify your request as made from a browser (using HTTP_USER_AGENT).
This is commonly done to avoid scripts scraping data automatically.

The ideal way to solve this would be to switch the HTTP_USER_AGENT
identifier to a standard browser (e.g. IE, Mozilla), but I'm not sure
how to do this.

Guo

On 12 September 2011 11:07, Ulrich Kohler <[email protected]> wrote:
> hi all,
>
> A program of mine wants to copy this file
>
> http://www.iso.org/iso/list-en1-semic-3.txt
>
> from the internet using something like
>
> . copy http://www.iso.org/iso/list-en1-semic-3.txt foo.txt
>
> With Stata 12 I get the error
>
> --
> file http://www.iso.org/iso/list-en1-semic-3.txt not found
> server says file temporarily redirected to
> http://www.iso.org/iso/home.html
> r(601);
> --
>
> although the file is shown without problems in a browser.
>
> Does anybody has an explanation for this?
>
> Uli
>
>
>
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index