You are here: Re: curl and download « PHP Programming Language « IT news, forums, messages
Re: curl and download

Posted by gehegeradeaus on 09/15/06 08:31

Andy Hassall schreef:

> On 14 Sep 2006 07:27:16 -0700, gehegeradeaus@gmail.com wrote:
>
> >I used curl a few times now, and it always worked fine... but now I
> >have a little question:
> >
> >If I post to a certain url , and that page returns a file for download.
> >(it doesn't display anything)
> >
> >How can accept the download, and read the contents...?
> >
> >My code :
> >
> >$postarr["user"] = "user";
> >$postarr["pw"] = "pw";
> >
> >$ch = curl_init();
> >curl_setopt($ch, CURLOPT_URL, "http://www.website.com/page.asp");
> >curl_setopt($ch, CURLOPT_HEADER, 0);
> >curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> >curl_setopt($ch, CURLOPT_POSTFIELDS, $postarr);
> >$data = curl_exec($ch);
> >curl_close($ch);
>
> Does this not work?
> Have you tried turning CURLOPT_VERBOSE on to work out why?
> At a wild guess do you need CURLOPT_FOLLOWLOCATION?
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

I forgot to tell you I'm posting to a https website... the error I get
is the following :

Connection to API feature not allowed for this user :
*user*-*user*-PSPID

cURL error number:0
cURL error:1

I suppose the problem lies in the website I post to?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация