|
 |
asp_web_howto thread: Server Status Check and FTP
Message #1 by ben@c... on Tue, 18 Sep 2001 13:49:50
|
|
Hi, could any one please help me?!
I have a ASP page that automatically FTP's XML pages to another server but
recently the recieving server has been down causing an error on our pages.
I am using a Stored Proceedure to run a batch file when FTPing across.
Is there anyway I could check to make sure the server I'll be sending the
files to is up and running?
Obviously if it isn't ok I don't want to FTP the pages over as it causes
an error. Any ideas... many thanks in advance.
Ben Cripps
Message #2 by "Daniel O'Dorisio" <dodorisio@h...> on Tue, 18 Sep 2001 09:08:24 -0400
|
|
You could ping it. But then again, they could still be down. I would try
to telnet on port 21 and see if you get a ftp status 220 back (I think
its 220) and then you are ready to go.
You would need to use a com object, and at that I don't know if you can
use the winsock control... (I have had no formal training on anything
computer... I just kinda hack it all... Anyway im only 16 so I have time
I guess) so I don't know about using ocx's in com objects of if that can
be done. I never tried.
Hth
daniel
-----Original Message-----
From: ben@c... [mailto:ben@c...]
Sent: Tuesday, September 18, 2001 1:50 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Server Status Check and FTP
Hi, could any one please help me?!
I have a ASP page that automatically FTP's XML pages to another server
but
recently the recieving server has been down causing an error on our
pages.
I am using a Stored Proceedure to run a batch file when FTPing across.
Is there anyway I could check to make sure the server I'll be sending
the
files to is up and running?
Obviously if it isn't ok I don't want to FTP the pages over as it causes
an error. Any ideas... many thanks in advance.
Ben Cripps
Message #3 by ben@c... on Wed, 19 Sep 2001 09:53:59
|
|
Thanks for your help and speedy response. I'll try the telnet like you
suggested, thanks.
> You could ping it. But then again, they could still be down. I would try
> to telnet on port 21 and see if you get a ftp status 220 back (I think
> its 220) and then you are ready to go.
>
> You would need to use a com object, and at that I don't know if you can
> use the winsock control... (I have had no formal training on anything
> computer... I just kinda hack it all... Anyway im only 16 so I have time
> I guess) so I don't know about using ocx's in com objects of if that can
> be done. I never tried.
>
> Hth
>
> daniel
>
> -----Original Message-----
> From: ben@c... [mailto:ben@c...]
> Sent: Tuesday, September 18, 2001 1:50 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] Server Status Check and FTP
>
>
> Hi, could any one please help me?!
>
> I have a ASP page that automatically FTP's XML pages to another server
> but
> recently the recieving server has been down causing an error on our
> pages.
>
> I am using a Stored Proceedure to run a batch file when FTPing across.
>
> Is there anyway I could check to make sure the server I'll be sending
> the
> files to is up and running?
>
> Obviously if it isn't ok I don't want to FTP the pages over as it causes
>
> an error. Any ideas... many thanks in advance.
>
> Ben Cripps
Message #4 by irfan.syed@g... on Wed, 19 Sep 2001 17:08:26 +0800
|
|
If you use Wininet control in VB, you can check the status of
connection and even the status of every single file transfer. e.g.
hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_PROXY, Proxy,
vbNullString, 0)
hConnection = InternetConnect(hOpen, Server, 21, Username, Password,
INTERNET_SERVICE_FTP, 0, 0)
---------------------------------------------
If hConnection = False Then
fileLog.writeline Now & " - " & "A connection to server could not
be established."
lblErrors.Caption = "A connection to server could not be
established."
InternetCloseHandle (hOpen)
Exit Sub
End If
----------------------------------------------
IS_
ben@c... on 09/19/2001 05:53:59 PM
Please respond to "ASP Web HowTo" <asp_web_howto@p...>
To: "ASP Web HowTo" <asp_web_howto@p...>
cc: (bcc: Irfan H Syed/DHS/DHBG)
Subject: [asp_web_howto] RE: Server Status Check and FTP
Thanks for your help and speedy response. I'll try the telnet like you
suggested, thanks.
> You could ping it. But then again, they could still be down. I would
try
> to telnet on port 21 and see if you get a ftp status 220 back (I
think
> its 220) and then you are ready to go.
>
> You would need to use a com object, and at that I don't know if you
can
> use the winsock control... (I have had no formal training on
anything
> computer... I just kinda hack it all... Anyway im only 16 so I have
time
> I guess) so I don't know about using ocx's in com objects of if that
can
> be done. I never tried.
>
> Hth
>
> daniel
>
> -----Original Message-----
> From: ben@c... [mailto:ben@c...]
> Sent: Tuesday, September 18, 2001 1:50 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] Server Status Check and FTP
>
>
> Hi, could any one please help me?!
>
> I have a ASP page that automatically FTP's XML pages to another
server
> but
> recently the recieving server has been down causing an error on our
> pages.
>
> I am using a Stored Proceedure to run a batch file when FTPing
across.
>
> Is there anyway I could check to make sure the server I'll be
sending
> the
> files to is up and running?
>
> Obviously if it isn't ok I don't want to FTP the pages over as it
causes
>
> an error. Any ideas... many thanks in advance.
>
> Ben Cripps
|
|
 |