 |
|
 |
|
01-15-06 10:52 PM
I'm wondering whether it is possible to retrieve a file using the
shell's ftp command when I have just the http:// URL of the file.
Example: if this is possible, could you indicate the keystrokes to
have ftp retrieve this file from this particular URL:
http://www.rahul.net/dkafman/wget16b.zip
It's a roundabout way to do the job, but I'm interested in knowing
whether it's feasible.
--
John Savage (my news address is not valid for email)
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: using ftp to do http:// |
 |
 |
|
|
01-15-06 10:52 PM
On Sun, 15 Jan 2006 19:42:10 GMT, John Savage
<rookswood@suburbian.com.au> wrote:
> I'm wondering whether it is possible to retrieve a file using the
> shell's ftp command when I have just the http:// URL of the file.
> Example: if this is possible, could you indicate the keystrokes to
> have ftp retrieve this file from this particular URL:
>
> http://www.rahul.net/dkafman/wget16b.zip
>
> It's a roundabout way to do the job, but I'm interested in knowing
> whether it's feasible.
It's possible if the server allows it. Try browsing to that address
with ftp:// instead of http://. Some ftp clients, for example ncftp,
can use the URL. For others, you would have to:
ftp www.rahul.net
user anonymous your@email.address
get dkafman/wget16b.zip
--
Documentation:
Instructions translated from Swedish by Japanese for English
speaking persons.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: using ftp to do http:// |
 |
 |
|
|
01-15-06 10:52 PM
John Savage <rookswood@suburbian.com.au> writes:
> I'm wondering whether it is possible to retrieve a file using the
> shell's ftp command when I have just the http:// URL of the file.
> Example: if this is possible, could you indicate the keystrokes to
> have ftp retrieve this file from this particular URL:
>
> http://www.rahul.net/dkafman/wget16b.zip
>
> It's a roundabout way to do the job, but I'm interested in knowing
> whether it's feasible.
It's possible only if the remote system runs both a web server and an
ftp server that provide access to the same file. It's not possible in
general. ftp and http are two different protocols, running (by
default) on two different ports. The ftp command can only talk to an
ftp server.
There are clients that can talk to either an ftp server or an http (or
https) server; see "wget", "curl", "lynx -source", and probably others.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: using ftp to do http:// |
 |
 |
|
|
02-03-06 10:56 PM
Keith Thompson <k...@mib.org> writes:
>John Savage <rooksw...@suburbian.com.au> writes:
^^^^ ^^^^^
now fixed misspelled & updated URL
[vbcol=seagreen]
>
>It's possible only if the remote system runs both a web server and an
>ftp server that provide access to the same file. It's not possible in
>general.
>ftp and http are two different protocols, running (by
>default) on two different ports. The ftp command can only talk to an
>ftp server.
I'm not sure just how correct you are. For example, I can ftp to the
newsserver port here and read a short news article (#), and can ftp to
my pop server port to examine new mail, so I'm wondering whether it is
possible to ftp to the web server and navigate around a bit. It may
be a bit painstaking, but in the absence of anything more, can FTP
be shoehorned into the job? (The "quote" command is invaluable here.)
I seem to recall seeing some sequence like ftp GET / to see the home
web page.
(#) this is not feasible with all ftp clients, I've found that some
do not pass back more than 1 line at a time--meaning that reading email
via that client would be tortuous
--
John Savage (my news address is not valid for email)
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: using ftp to do http:// |
 |
 |
|
|
02-03-06 10:56 PM
John Savage <rookswood@suburbian.com.au> writes:
> Keith Thompson <k...@mib.org> writes:
[snip][vbcol=seagreen]
>
>
> I'm not sure just how correct you are. For example, I can ftp to the
> newsserver port here and read a short news article (#), and can ftp to
> my pop server port to examine new mail, so I'm wondering whether it is
> possible to ftp to the web server and navigate around a bit. It may
> be a bit painstaking, but in the absence of anything more, can FTP
> be shoehorned into the job? (The "quote" command is invaluable here.)
> I seem to recall seeing some sequence like ftp GET / to see the home
> web page.
>
> (#) this is not feasible with all ftp clients, I've found that some
> do not pass back more than 1 line at a time--meaning that reading email
> via that client would be tortuous
If your ftp client can talk to an NNTP server, or to an HTTP server,
then it's acting as an NNTP or HTTP client, even if the client program
happens to have "ftp" somewhere in its name. It's about the protocol
being used for communication.
I suppose it's conceivable that the NNTP and FTP protocols are
sufficiently compatible that you can do something using an FTP client
talking to port 119 (the standard port for nntp), but I didn't think
so.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: using ftp to do http:// |
 |
 |
|
|
02-04-06 07:48 AM
In article <06020400094905.04Feb06$rookswood@suburbian.com>,
John Savage <rookswood@suburbian.com.au> wrote:
> Keith Thompson <k...@mib.org> writes:
>
> I'm not sure just how correct you are. For example, I can ftp to the
> newsserver port here and read a short news article (#), and can ftp to
I don't see how this works. FTP expects two types of responses to a
command: a single-line response with the format "<code> <message>"; or a
multi-line response where all but the last line have the format
"<code>-<message>" and the last is "<code> <message>". NNTP has the
single-line responses, but when you're downloading an article it doesn't
use a different approach for multi-line responses (I think it sends the
message text followed by a line with just a ".").
So I'm at a loss to understand how an FTP client would recognize the end
of the article -- it doesn't know to look for the "." line.
> my pop server port to examine new mail, so I'm wondering whether it is
> possible to ftp to the web server and navigate around a bit. It may
> be a bit painstaking, but in the absence of anything more, can FTP
> be shoehorned into the job? (The "quote" command is invaluable here.)
> I seem to recall seeing some sequence like ftp GET / to see the home
> web page.
HTTP requires that after the GET line the client send a request-header
and then a blank line. I don't know how you can get your FTP client to
send this. And then it would have to parse the response header to look
for the Content-Length: line to determine when it's done reading the
document.
> (#) this is not feasible with all ftp clients, I've found that some
> do not pass back more than 1 line at a time--meaning that reading email
> via that client would be tortuous
That's the point I was making above. It sounds like your FTP client is
extremely lenient in handling responses that violate the protocol, which
allows it to handle some of these protocols that are "kind of" FTP-like.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: using ftp to do http:// |
 |
 |
|
|
02-04-06 07:48 AM
Barry Margolin <barmar@alum.mit.edu> writes:
> In article <06020400094905.04Feb06$rookswood@suburbian.com>,
> John Savage <rookswood@suburbian.com.au> wrote:
>
>
> I don't see how this works. FTP expects two types of responses to a
> command: a single-line response with the format "<code> <message>"; or a
> multi-line response where all but the last line have the format
> "<code>-<message>" and the last is "<code> <message>". NNTP has the
> single-line responses, but when you're downloading an article it doesn't
> use a different approach for multi-line responses (I think it sends the
> message text followed by a line with just a ".").
>
> So I'm at a loss to understand how an FTP client would recognize the end
> of the article -- it doesn't know to look for the "." line.
It doesn't work.
On some systems, there's a command named GET:
[pjb@thalassa pjb]$ GET /
<HTML>
<HEAD>
<TITLE>Directory /</TITLE>
<BASE HREF="file:/">
</HEAD>
<BODY>
<H1>Directory listing of /</H1>
<UL>
<LI><A HREF=".%2F">./</A>
<LI><A HREF="..%2F">../</A>
<LI><A HREF="HDC3">HDC3</A>
<LI><A HREF="a-backup%2F">a-backup/</A>
...
<LI><A HREF="var%2F">var/</A>
<LI><A HREF="vm%2F">vm/</A>
</UL>
</BODY>
</HTML>
[pjb@thalassa pjb]$ GET http://localhost:80/
<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN//3.0">
<html>
<head>
<title>THALASSA Overview</title>
</head>
<body>
<h1 align=center>THALASSA caught by the spider</h1>
<h2 align=center>(Local pages)</h2>
...
</body>
</html>
[pjb@thalassa pjb]$
If you're not careful, you may think that you type GET / to your ftp
client but the shell actually receives it since the ftp client is lost
in the protocol inconsistencies, in particular if emacs is there to
help in the mess:
[pjb@thalassa pjb]$ ftp ftp://localhost:80
Trying ::1...
Trying 127.0.0.1...
Connected to localhost. ; nothing happens, ftp is blocked.
GET / ; I type this; nothing happens.
C-c C-c ; I break:
421 Service not available, user interrupt. Connection closed.
ftp: Can't connect or login to host `localhost'
; the emacs eventually sends GET /
; to the shell:
[pjb@thalassa pjb]$ <HTML>
<HEAD>
<TITLE>Directory /</TITLE>
<BASE HREF="file:/">
</HEAD>
<BODY>
<H1>Directory listing of /</H1>
<UL>
<LI><A HREF=".%2F">./</A>
<LI><A HREF="..%2F">../</A>
<LI><A HREF="HDC3">HDC3</A>
<LI><A HREF="a-backup%2F">a-backup/</A>
...
<LI><A HREF="var%2F">var/</A>
<LI><A HREF="vm%2F">vm/</A>
</UL>
</BODY>
</HTML>
[pjb@thalassa pjb]$
--
__Pascal Bourguignon__ http://www.informatimago.com/
Litter box not here.
You must have moved it again.
I'll poop in the sink.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 05:18 PM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
Medical and Health forum | Computer Games Reviews | Graphics design forum
|
 |
|
 |
|