cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

unsubscribe

From: teguh <hantut_at_telkom.net>
Date: Mon, 18 Jun 2007 19:06:15 +0700

----- Original Message -----
From: <curl-and-php-request_at_cool.haxx.se>
To: <curl-and-php_at_cool.haxx.se>
Sent: Monday, June 18, 2007 5:00 PM
Subject: curl-and-php Digest, Vol 22, Issue 5

> Send curl-and-php mailing list submissions to
> curl-and-php_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> or, via email, send a message with subject or body 'help' to
> curl-and-php-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-and-php-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-and-php digest..."
>
>
> Today's Topics:
>
> 1. Re: Not able to follow redirections (Gowranga)
> 2. Sending Large Files (Jacob Oliver)
> 3. Re: Sending Large Files (simon_at_ice.org)
> 4. Re: Sending Large Files (Jacob Oliver)
> 5. Re: Sending Large Files (Wai Keong Ho)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 16 Jun 2007 17:34:58 +0530 (IST)
> From: "Gowranga" <gowranga_at_serc.iisc.ernet.in>
> Subject: Re: Not able to follow redirections
> To: "curl with PHP" <curl-and-php_at_cool.haxx.se>
> Message-ID:
> <1084.59.96.41.71.1181995498.squirrel_at_mail.serc.iisc.ernet.in>
> Content-Type: text/plain;charset=iso-8859-1
>
> > You should probably enable cookies to get things working just like your
> browser does.
> >
> >> HTTP/1.0 302 Moved Temporarily
> >> Location: http://www.google.co.in/
> >
> > You got a redirect!
> >
> >> HTTP/1.0 200 OK
> >
> > ... and the subsequent response was fine too.
> >
>
> I have included cookies and the script is as follows:
>
> ---------------------------------
> <?php
> $url = "http://www.google.com";
> $string="PREF=ID";
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,$url);
> curl_setopt($ch, CURLOPT_PROXY, "xx1.xx.xx.xx:port");
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_VERBOSE, 1);
> curl_setopt($ch, CURLOPT_COOKIE, $string);
> curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie.txt");
> curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookie.txt");
> curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com");
> curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT
> 5.1; en-US; rv:1.7.13) Gecko/20060414");
> curl_exec($ch);
>
> $url = "http://www.google.co.in";
> $string="PREF=ID";
> curl_setopt($ch, CURLOPT_URL,$url);
> curl_setopt($ch, CURLOPT_PROXY, "xx1.xx.xx.xx:port");
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_VERBOSE, 1);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
> curl_setopt($ch, CURLOPT_COOKIE, $string);
> curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie.txt");
> curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookie.txt");
> curl_setopt($ch, CURLOPT_REFERER, "http://www.google.co.in");
> //curl_setopt($ch, CURLOPT_COOKIESESSION, "/tmp/cookie.txt");
> curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT
> 5.1; en-US; rv:1.7.13) Gecko/20060414");
> $result = curl_exec($ch);
> curl_close($ch);
> echo $result;
> ?>
>
> ---------------------------------
> The contents of /tmp/cookie.txt(permissions set as 0755) appear as
>
> # Netscape HTTP Cookie File
> # http://curlm.haxx.se/rfc/cookie_spec.html
> # This file was generated by libcurl! Edit at your own risk.
>
> .google.com TRUE / FALSE 2147483647
> PREF ID=cf2bba2e5154b172:TM=1181963457:LM=1181963457:S=Gs42Z_ZkJ7JMflUE
> .google.co.in TRUE / FALSE 2147483647
> PREF ID=b90f5f526bde641b:TM=1181963457:LM=1181963457:S=H6m7RvfwUB-MnJeN
> ---------------------------------
> I do get a favourable response on the browser:
>
> ---------------------------------
> HTTP/1.0 302 Moved Temporarily Location: http://www.google.co.in/
> Cache-Control: private Content-Type: text/html Server: GWS/2.1
> Content-Length: 221 Date: Sat, 16 Jun 2007 10:55:12 GMT X-Cache: MISS from
> xx1.xx.xx.xx Proxy-Connection: close
> 302 Moved
> The document has moved here. HTTP/1.0 200 OK Cache-Control: private
> Content-Type: text/html; charset=UTF-8 Server: GWS/2.1 Date: Sat, 16 Jun
> 2007 10:55:13 GMT X-Cache: MISS from xx1.xx.xx.xx Proxy-Connection: close
> ---------------------------------
>
> However, the response is the same even when CURLOPT_FOLLOWLOCATION
> option is not chosen. And the URL does not change in either case.
>
> Thanks
>
> -gowranga
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 17 Jun 2007 18:31:52 -0400
> From: Jacob Oliver <olivej2_at_gmail.com>
> Subject: Sending Large Files
> To: curl-and-php_at_cool.haxx.se
> Message-ID: <4675B658.5070400_at_gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> I'm trying to curl a movie to a a php file and it won't send the file, I
> believe this is because of file limits (a 1 MB file works and a 10 MB
> file doesn't). I don't know if the problem is with curl or php though.
>
> Here is my curl statement:
> curl -F "video_file=@///Users/myname/Desktop/movie.mov"
> http://localhost/file.php
>
> all headers look correct and like I said it works for smaller files.
>
> file.php is just one line:
> echo $HTTP_POST_FILES['video_file']['name'];
>
> nothing gets written out
> and I changed php.ini to allow up to 200MB file uploads and apache to
> allow unlimited
>
> any suggestions?
>
> Thank you
> Jacob
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 18 Jun 2007 00:38:57 +0200
> From: simon_at_ice.org
> Subject: Re: Sending Large Files
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <4675B801.4030100_at_ice.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> There are a few options in php.ini that dictate file uploads -
> notably - POST size, upload size, and also script timeouts.
>
> If you scroll the entire sample ini you should be able to eliminate all
> these variables, but it's probably the POST limit...
>
> Jacob Oliver wrote:
> > Hi,
> >
> > I'm trying to curl a movie to a a php file and it won't send the file, I
> > believe this is because of file limits (a 1 MB file works and a 10 MB
> > file doesn't). I don't know if the problem is with curl or php though.
> >
> > Here is my curl statement:
> > curl -F "video_file=@///Users/myname/Desktop/movie.mov"
> > http://localhost/file.php
> >
> > all headers look correct and like I said it works for smaller files.
> >
> > file.php is just one line:
> > echo $HTTP_POST_FILES['video_file']['name'];
> >
> > nothing gets written out
> > and I changed php.ini to allow up to 200MB file uploads and apache to
> > allow unlimited
> >
> > any suggestions?
> >
> > Thank you
> > Jacob
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 17 Jun 2007 22:14:01 -0400
> From: Jacob Oliver <olivej2_at_gmail.com>
> Subject: Re: Sending Large Files
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <4675EA69.9020303_at_gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> You're right. It still didn't work. When I add -o to the end it gives
me:
>
> % Total % Received % Xferd Average Speed Time Time Time
> Current
> Dload Upload Total Spent Left
> Speed
> 100 11.1M 0 49 100 11.1M 41 9756k 0:00:01 0:00:01 --:--:--
> 10.6M
>
> really I'm having trouble discerning if the problem is on the php or the
> curl side?
>
> simon_at_ice.org wrote:
> > There are a few options in php.ini that dictate file uploads -
> > notably - POST size, upload size, and also script timeouts.
> >
> > If you scroll the entire sample ini you should be able to eliminate all
> > these variables, but it's probably the POST limit...
> >
> > Jacob Oliver wrote:
> >
> >> Hi,
> >>
> >> I'm trying to curl a movie to a a php file and it won't send the file,
I
> >> believe this is because of file limits (a 1 MB file works and a 10 MB
> >> file doesn't). I don't know if the problem is with curl or php though.
> >>
> >> Here is my curl statement:
> >> curl -F "video_file=@///Users/myname/Desktop/movie.mov"
> >> http://localhost/file.php
> >>
> >> all headers look correct and like I said it works for smaller files.
> >>
> >> file.php is just one line:
> >> echo $HTTP_POST_FILES['video_file']['name'];
> >>
> >> nothing gets written out
> >> and I changed php.ini to allow up to 200MB file uploads and apache to
> >> allow unlimited
> >>
> >> any suggestions?
> >>
> >> Thank you
> >> Jacob
> >> _______________________________________________
> >> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >>
> >>
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >
> >
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 18 Jun 2007 10:24:46 +0800
> From: "Wai Keong Ho" <sewerside_at_gmail.com>
> Subject: Re: Sending Large Files
> To: "curl with PHP" <curl-and-php_at_cool.haxx.se>
> Message-ID:
> <358536da0706171924o58acf682nd430ee5d88837e07_at_mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> probably php side.. as 100mb will take quite some time, u need to change
to
> a higher script timeout, judge yourself how an average slow Joe would take
> to download your file
>
> On 6/18/07, Jacob Oliver <olivej2_at_gmail.com> wrote:
> >
> > You're right. It still didn't work. When I add -o to the end it gives
> > me:
> >
> > % Total % Received % Xferd Average Speed Time Time Time
> > Current
> > Dload Upload Total Spent Left
> > Speed
> > 100 11.1M 0 49 100 11.1M 41 9756k 0:00:01 0:00:01 --:--:--
> > 10.6M
> >
> > really I'm having trouble discerning if the problem is on the php or the
> > curl side?
> >
> > simon_at_ice.org wrote:
> > > There are a few options in php.ini that dictate file uploads -
> > > notably - POST size, upload size, and also script timeouts.
> > >
> > > If you scroll the entire sample ini you should be able to eliminate
all
> > > these variables, but it's probably the POST limit...
> > >
> > > Jacob Oliver wrote:
> > >
> > >> Hi,
> > >>
> > >> I'm trying to curl a movie to a a php file and it won't send the
file,
> > I
> > >> believe this is because of file limits (a 1 MB file works and a 10 MB
> > >> file doesn't). I don't know if the problem is with curl or php
though.
> > >>
> > >> Here is my curl statement:
> > >> curl -F "video_file=@///Users/myname/Desktop/movie.mov"
> > >> http://localhost/file.php
> > >>
> > >> all headers look correct and like I said it works for smaller files.
> > >>
> > >> file.php is just one line:
> > >> echo $HTTP_POST_FILES['video_file']['name'];
> > >>
> > >> nothing gets written out
> > >> and I changed php.ini to allow up to 200MB file uploads and apache to
> > >> allow unlimited
> > >>
> > >> any suggestions?
> > >>
> > >> Thank you
> > >> Jacob
> > >> _______________________________________________
> > >> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> > >>
> > >>
> > >
> > > _______________________________________________
> > > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> > >
> > >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://cool.haxx.se/pipermail/curl-and-php/attachments/20070618/da46ec55/att
achment-0001.htm
>
> ------------------------------
>
> _______________________________________________
> curl-and-php mailing list
> curl-and-php_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
> End of curl-and-php Digest, Vol 22, Issue 5
> *******************************************

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-06-18