Curl for file download via POST


up vote
0
down vote
favorite
I use curl to send POST data, and expect to get a zip file back. The curl POST command seems to execute Ok, and I can see that the server tries to send the zip file (dataset.zip) as an attachment, but I don't know how to get it. Am I missing a curl option? Please help! This is the command + output:
curl -ksb "COOKIE.txt" --request POST -d params="$params" -v "https://MYSERVER.com/downloadDatasetsByParams"
HTTP/1.1 200 OK
Date: Tue, 20 Mar 2018 23:35:13 GMT
Server Apache-Coyote/1.1 is not blacklisted
Server: Apache-Coyote/1.1
content-disposition: attachment; filename=dataset.zip
Content-Type: application/x-download
Set-Cookie: X_Email=kUser@mserver.com
Transfer-Encoding: chunked
Failed writing body (0 != 4096)
Failed writing data
Marked for [closure]: Transfer returned error
multi_done
stopped the pause stream!
Closing connection 0
The cache now contains 0 members
TLSv1.2 (OUT), TLS alert, Client hello (1):
curl
add a comment |Â
up vote
0
down vote
favorite
I use curl to send POST data, and expect to get a zip file back. The curl POST command seems to execute Ok, and I can see that the server tries to send the zip file (dataset.zip) as an attachment, but I don't know how to get it. Am I missing a curl option? Please help! This is the command + output:
curl -ksb "COOKIE.txt" --request POST -d params="$params" -v "https://MYSERVER.com/downloadDatasetsByParams"
HTTP/1.1 200 OK
Date: Tue, 20 Mar 2018 23:35:13 GMT
Server Apache-Coyote/1.1 is not blacklisted
Server: Apache-Coyote/1.1
content-disposition: attachment; filename=dataset.zip
Content-Type: application/x-download
Set-Cookie: X_Email=kUser@mserver.com
Transfer-Encoding: chunked
Failed writing body (0 != 4096)
Failed writing data
Marked for [closure]: Transfer returned error
multi_done
stopped the pause stream!
Closing connection 0
The cache now contains 0 members
TLSv1.2 (OUT), TLS alert, Client hello (1):
curl
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I use curl to send POST data, and expect to get a zip file back. The curl POST command seems to execute Ok, and I can see that the server tries to send the zip file (dataset.zip) as an attachment, but I don't know how to get it. Am I missing a curl option? Please help! This is the command + output:
curl -ksb "COOKIE.txt" --request POST -d params="$params" -v "https://MYSERVER.com/downloadDatasetsByParams"
HTTP/1.1 200 OK
Date: Tue, 20 Mar 2018 23:35:13 GMT
Server Apache-Coyote/1.1 is not blacklisted
Server: Apache-Coyote/1.1
content-disposition: attachment; filename=dataset.zip
Content-Type: application/x-download
Set-Cookie: X_Email=kUser@mserver.com
Transfer-Encoding: chunked
Failed writing body (0 != 4096)
Failed writing data
Marked for [closure]: Transfer returned error
multi_done
stopped the pause stream!
Closing connection 0
The cache now contains 0 members
TLSv1.2 (OUT), TLS alert, Client hello (1):
curl
I use curl to send POST data, and expect to get a zip file back. The curl POST command seems to execute Ok, and I can see that the server tries to send the zip file (dataset.zip) as an attachment, but I don't know how to get it. Am I missing a curl option? Please help! This is the command + output:
curl -ksb "COOKIE.txt" --request POST -d params="$params" -v "https://MYSERVER.com/downloadDatasetsByParams"
HTTP/1.1 200 OK
Date: Tue, 20 Mar 2018 23:35:13 GMT
Server Apache-Coyote/1.1 is not blacklisted
Server: Apache-Coyote/1.1
content-disposition: attachment; filename=dataset.zip
Content-Type: application/x-download
Set-Cookie: X_Email=kUser@mserver.com
Transfer-Encoding: chunked
Failed writing body (0 != 4096)
Failed writing data
Marked for [closure]: Transfer returned error
multi_done
stopped the pause stream!
Closing connection 0
The cache now contains 0 members
TLSv1.2 (OUT), TLS alert, Client hello (1):
curl
curl
edited Mar 21 at 0:19
asked Mar 21 at 0:03


kUser
11
11
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Newbie mistake. It works with the -o option:
-o "outputfile.txt"
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Newbie mistake. It works with the -o option:
-o "outputfile.txt"
add a comment |Â
up vote
0
down vote
Newbie mistake. It works with the -o option:
-o "outputfile.txt"
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Newbie mistake. It works with the -o option:
-o "outputfile.txt"
Newbie mistake. It works with the -o option:
-o "outputfile.txt"
answered Mar 21 at 1:09


kUser
11
11
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1017773%2fcurl-for-file-download-via-post%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password