This Question is Assumed Answered

1 "correct" answer available (5 pts) 15 "helpful" answers available (3 pts)
3 Replies Last post: Apr 15, 2008 10:19 AM by Duke

Communication between Curl and PHP

Apr 13, 2008 11:08 PM

Click to view URPradhan's profile BlackBelt URPradhan 166 posts since
Mar 6, 2008
Hi Friends

Can we mixup Curl and PHP programming together ?
Suppose I have to upload a file to web server. And I'll use a Curl Form for posting the file to server with (calling) a PHP action script. Like ...
{HttpForm
{url "http://www.example.com/mysite/uploadfile.php"},
.......
}

Is it possible ?

//Thanx
Click to view mgordon's profile Curl mgordon 48 posts since
Oct 17, 2007
1. Re: Communication between Curl and PHP Apr 14, 2008 5:51 AM
You can upload files using HttpForm. Search for "upload" in the Curl documentation. There is an example there that might answer your question.
Click to view URPradhan's profile BlackBelt URPradhan 166 posts since
Mar 6, 2008
2. Re: Communication between Curl and PHP Apr 14, 2008 8:51 PM
in response to: mgordon
I had seen that example, but that uses the perl action script like .....
{HttpForm
{url "http://www.curl.com/cgi-bin/file-upload.pl"},

So instead of perl I want to use PHP and I believe we can do it.
Click to view Duke's profile Curl Duke 179 posts since
Oct 17, 2007
3. Re: Communication between Curl and PHP Apr 15, 2008 10:19 AM
in response to: URPradhan
The Curl HttpForm , using method=HttpRequestMethod.post, encoding=HttpFormData.multipart-mime-type , should work with PHP as is shown in http://us3.php.net/features.file-upload .