Syntax issue in curl for getting a file from http site


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Syntax issue in curl for getting a file from http site
# 1  
Old 05-18-2012
Syntax issue in curl for getting a file from http site

Hi All

I am using curl in my client environment. We need to pull a file from the libraries site. All the files are having perticular URL which can be used to get the files. Only issue is, when we fire that command , it will take to authentication page 1st. once authentication is succed, it will redirected back to that file location.

when i fire this command
** apended "a" before http to avoid making that a URL in this blog
Code:
curl -v -L --user <USERID>:<PASSWORD> ahttp://XXXXXXXXX/upload/15872/doc_3409575.txt -o TGT_OP.txt

its showing

location is the authentication site and finally comming out as
Connection #0 to host XXXXXXXXX left intact

Can you please let me know what alternative i can try to acomplish this?

--Thanks in advance

Last edited by Corona688; 05-18-2012 at 11:53 AM..
# 2  
Old 05-18-2012
The --user option only applies to simple HTTP authentication, not complex schemes with login pages and cookies.

It may be possible to do this with curl still but how to do so depends on the page in question.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Curl/http 503 error with bash script

I am trying to use REST API and curl in a bash script to generate a http report. The curl command at the end of the script should generate a html file but instead I get an error "HTTP/1.1 503 Service Unavailable". This is the script #!/bin/bash export... (7 Replies)
Discussion started by: kieranfoley
7 Replies

2. Shell Programming and Scripting

CURL syntax

Topic : cmd to check status of url using Curl I have below 2 lines which r working fine /usr/bin/curl -u user:pasword http://hostname /usr/bin/curl -connect-timeout=10 http://hostname Now I want to use user:pasword and connect-timeout parameter in one line /usr/bin/curl -u user:pasword... (1 Reply)
Discussion started by: sam@sam
1 Replies

3. Shell Programming and Scripting

CURL Button Click Issue

I am trying to perform a button click via cURL and I am having an issue possibly due to java script on click. The HTML source code is: <input id="ctl00_SPWebPartManager1_g_1bb6dc86_55ab_4ea9_a4db_4747922a8202_ctl00_RequestOption_0" class="radio" type="radio" checked="checked" value="1"... (5 Replies)
Discussion started by: js0505
5 Replies

4. Shell Programming and Scripting

Wget vs Curl - Proxy issue

Hi, My script needs to crawl the data from a third party site. Currently it is written in wget. The third party site is of shared interface with different IP addresses. My wget works with all the IP address but not with one. Whereas the curl is able to hit that IP address and comes out... (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

5. UNIX for Advanced & Expert Users

Syntax error /w curl?

Hello all- I'm (hopefully) trying to replace a WS_FTP (Windows program) job with a curl command in a script on UNIX. In short, this process has been in place for some time, and in curl I am getting directory perm issues, which does not seem to be accurate, since this process has been in place... (2 Replies)
Discussion started by: prestonatwork
2 Replies

6. UNIX for Advanced & Expert Users

Issue in Curl to send http POST request with attachment/multipart

Hi, I am using curl to hit a url using http in solaris 10 using commandline, I want to transfer an attachment(using multipart curl -F) also as a part of the request. If anyone has used kindly help me with the syntax. I am using below command: Code: /usr/local/bin/curl -v... (1 Reply)
Discussion started by: manishmaha
1 Replies

7. Shell Programming and Scripting

Unable to access http site using wget through proxy

Hi there I am currently trying to access an http site using the wget utility from a solaris box. I am going through proxies to do this and we have two types of proxies. For the first one, which is a netcache proxy, I am able to use the wget command to export the proxy information export... (2 Replies)
Discussion started by: memonks
2 Replies

8. Shell Programming and Scripting

syntax issue in ksh file

Hi all, I am struck with syntax for long time, Need to purge some lines from given file Not able to use value of $x Example of ksh script... Facing some syntax issue. Have Tried ‘with single , double ,backtick “” ` and \ escape character , doesn't seem to work. <line 1> echo $x #... (2 Replies)
Discussion started by: manav666
2 Replies
Login or Register to Ask a Question