cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Issue with file upload using curl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 13 Dec 2012 17:26:23 +0100

On Thu, Dec 13, 2012 at 10:17:22AM -0500, Raviteja Tirumalasetti wrote:
> Thanks for the information Dan, I am able to view the operations using
> the LiveHttpHeaders tool for check in the file. But, I am not able to
> do it the same way using curl. Can you please let me know how to do
> the below operation using curl?

Note that you've shared your cookies and form contents with a public
mailing list, so I hope there isn't anything confidential on that site.

This looks like a typical, ugly scraping operation you're embarking on;
ugly because it's often difficult to reverse engineer. You'll have to
analyze the request parameters to see what is relevant and what isn't.
There are often hidden parameters that you have to deal with, and
occasionally need to dynamically compute. And then there are cookies,
which are sometimes tricky to gather when they involve a login process
of some sort.

But the curl part should be easy. Both POSTs are using
application/x-www-form-urlencoded forms, so your curl command-line is
probably going to end up looking as simple as something like this:

  curl -d@post-parameters-file --cookie=cookie-file http://cortex.cablevision.com/sites/metdev/...

It can take hours getting the contents of post-parameters-file and
cookie-file just right, and then a few weeks later they change the site
and you have to do it all again.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-12-13