I am doing a GET, download, not a put
Main Topics
Browse All TopicsI have perl curl scrip tot download an https file. Please do not recommend another method, I am tied to this method. Additionally, I do not have a certificate to use as well. The script is able to log in but is does not put the file. Filename3 contains
HTTP/1.1 200 OK
Date: Mon, 29 Dec 2008 16:06:37 GMT
Server: SecureTransport/4.7
Set-Cookie: FDX=asfdafdafafasfd; path=/; Secure
Accept-Ranges: bytes
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Features: CHPWD;RTCK;STCK;ASC;DNDISP
Transfer-Encoding: chunked
Content-Type: text/plain; charset=UTF-8
Virtual user username1 logged in.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
when I run
$get=`/usr/local/bin/curl -o output.txt -k -u username1:password -O https://secureserver.com/f
output.txt is
Virtual user username1 logged in.
I don't know what to say. Below is my script, verbatim, except for the user/pwd string.
After executing the script, the output.txt file contains the index.html.
Can you post your full perl script (if you have any other code)? Also, which version of curl are you using? I'm using curl 7.16.3, compiled for cygwin.
By the way, if you use -O (upper-cased "oh"), instead of -o (lower-cased "oh"), curl will save to a filename with the same name as the source, so there is no need to specify an output filename.
-dZ.
Could it be the location of the file? What I mean is when I manually login into my site I see the file. However, do I assume that on my site it is merely the url name and file ? ie https://secureserver.com/f
It could be the location of the file; however, I don't see why it would tell you "user logged in" without an error or output, unless that *is* the output.
When I try that URL, I get a 404 error: "/filename3 was not found on this server".
Is there a query string value that is being processed by an application on the back-end?
How do you access the file "manually"?
-dZ.
I understand. But my question remains: when you "see" the file, is it a hyperlink to a physical file, a javascript function, a hyperlink with QueryString parameters, or something else? Also, have you analysed the HTTPS transaction when you download the file to see if there is any redirection involved?
-dZ.
Sorry for the confusion. If you View|Source of the page, is the link to the file a straight anchor hyperlink, or is it a call to a server script with paramters?
To determine if there are any redirects, you could use, for example, the Firefox extension "HTTP Headers", or a TCP/IP debugger, like WireShark.
In a pinch, you could try disabling redirects in the browser (typically possible in developer browsers, such as Firefox, Opera, or Safari; I'm not sure if IE offers this) and see what it does.
-dZ.
The source for the download is :
<SCRIPT>PrintFileURL("filena
<SCRIPT>PrintFileURL("filena
Additioanlly, Firefox hhtp headers did not indicate a redirect
I see that the only downloadable link that is generated by PrintFileURL() is the following:
document.write(
'<a class="tx0" href="javascript:ActiveXDo
'onMouseOver="window.statu
'onMouseOut="window.status
There are two parts which I cannot decipher without further information. They are the object "files", which is used by the function to operate on each filename; and the ActiveXDownload() method.
There are also various methods of the "files" object which are suspect, such as click_it() and add().
Since none of these things are defined in this file, I pressume they all reside within the library file "/scripts/include_list_htm
You could post that code in here, so that we may continue to analyse it. But I think the easiest way would be to view the HTTP headers submitted when you click on the file to figure out which is ultimately the request being submitted.
Keep in mind that if the request is not authenticated, it may appear as two request/response cycles: one for the original request, in which the server responds with a 302 status code to request authentication; the other one to actually perform the request with the authentication information.
Perhaps you could post the HTTP transaction log here, anonymised where appropriate, of coursed.
-dZ.
Sorry, I should have explained with more details. You should be able to get the JS script file by just putting its address in the address bar of your browser (following the domain of the URL, of course). Then save it from the browser into a file.
As for the HTTP transaction log, I thought that since you mentioned Firefox's HTTP headers, that you were using the HTTP Header extension, which will show the transaction. In any case, the Page Info|HTTP Header tab for the downloaded file should suffice. Just view it while you have the open/save as dialog open.
-dZ.
Bingo!
I can discern a few things of note from that transcript. First, that after logging in, you are given a Cookie called "FDX", for example:
FDX=624e767a474e796a4b4869
And second, that the request includes a querystring parameter:
GET /filename3?B
Another thing to note is that the request specifically uses HTTP 1.1, so you should make sure that your curl command string does not include the "-0" (that's a number zero), which forces the program to use HTTP 1.0.
The second point I mentioned above is easy to address: just change your URL to include the parameter:
https://secureserver.com/f
The first one is a bit more involved. First, I would suggest trying without cookies, just to see if you can get away with it. But if indeed it requires a cookie, then you may need to perform two requests: one to log in and receive a cookie; and the second one to retrieve the file, with the "-B" option to include the cookie. Note that you will need to parse the response of the first one to retrieve the cookie value (or use the "-c" option to automatically store cookies in a "cookie jar).
-dZ.
You could, as long as the server supports sFTP. sFTP requires an FTP server running locally on the server, which is independent from the HTTP server.
And you will need the full path to the file and permissions to access the file, as opposed to the HTTP request, where only the HTTP server requires access permissions to the file (you only require access permissions to the application).
-dZ.
Business Accounts
Answer for Membership
by: DropZonePosted on 2008-12-30 at 05:48:49ID: 23262422
If you want to "PUT" the file, you need the -T option.
-dZ.