SunQuest
           FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 2nd, 2004, 09:14 AM
BenForbes's Avatar
BenForbes BenForbes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Melbourne - Australia
Posts: 35 BenForbes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Check if FTP server is online, JScript

I'd like to place some code (JScript) within an HTML document to check whether or not a certain IP is running an FTP server. If it is running, I'd like to display some text, like "Server Online". I can do everything except the FTP connection part. If this was C++ I would use WinInet or WinSock, but I'm new to JScript. Any help?
__________________
Ben Forbes
Windows XP Professional
MS Visual Studio .NET
1.53 ghz Athlon XP

Reply With Quote
  #2  
Old January 2nd, 2004, 10:09 AM
donpearson's Avatar
donpearson donpearson is offline
(,,,)( '.' )(,,,)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Looking at my screen
Posts: 476 donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 11 h 45 m 57 sec
Reputation Power: 9
Try this http://www.nathand.i.c.kman.com/scripts/

You need to take out the dots first d.i.c.k i could not post the url coz the forum takes it out...
__________________
Midnight Fun

Last edited by donpearson : January 2nd, 2004 at 10:13 AM.

Reply With Quote
  #3  
Old January 2nd, 2004, 10:13 AM
BenForbes's Avatar
BenForbes BenForbes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Melbourne - Australia
Posts: 35 BenForbes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
That link does not work, could you check it's validity?

Reply With Quote
  #4  
Old January 2nd, 2004, 10:14 AM
donpearson's Avatar
donpearson donpearson is offline
(,,,)( '.' )(,,,)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Looking at my screen
Posts: 476 donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 11 h 45 m 57 sec
Reputation Power: 9
try that....

You need to take out the dots first d.i.c.k i could not post the url coz the forum takes it out...

Reply With Quote
  #5  
Old January 2nd, 2004, 10:23 AM
BenForbes's Avatar
BenForbes BenForbes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Melbourne - Australia
Posts: 35 BenForbes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
The server this code will run on does not support cgi, asp or php, so the ServerStatus code will not work. Is there a way to create an FTP reqest through JScript, or VBScript if necessary?

Reply With Quote
  #6  
Old January 2nd, 2004, 10:26 AM
donpearson's Avatar
donpearson donpearson is offline
(,,,)( '.' )(,,,)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Looking at my screen
Posts: 476 donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level)donpearson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 11 h 45 m 57 sec
Reputation Power: 9
Sorry try this it javascript http://www.schwebhost.com/serverstatus/

That is the one i ment to post

Reply With Quote
  #7  
Old January 2nd, 2004, 10:35 AM
BenForbes's Avatar
BenForbes BenForbes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Melbourne - Australia
Posts: 35 BenForbes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thanks, but that is PHP not JavaScript. However I will search a JavaScript reference for the equivalent objects and functions.

Reply With Quote
  #8  
Old January 2nd, 2004, 07:04 PM
BenForbes's Avatar
BenForbes BenForbes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Melbourne - Australia
Posts: 35 BenForbes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I tried opening a socket like this:
Code:
Socket a=new Socket("www.google.com",80);

But then none of my javascript would work. Here is the whole thing:
Code:
<html>
<head>
<title>Page</title>
</head>
<body>
<script language="JavaScript">
document.write("<br />Hello World");
Socket a = new Socket("www.google.com",80);
</script>
</body>
</html>

Reply With Quote
  #9  
Old January 2nd, 2004, 07:38 PM
nolachrymose nolachrymose is offline
The Forest
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 321 nolachrymose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
As far as I know, there is no Socket() object in JavaScript..

You could probably use an ActiveX object for WSH for this problem. Another possible solution *might* be this: to upload an executable which is created from C++ that tests, and have it's content-type set to text/javascript (or, more appropriately these days, application/x-javascript). If this works, you could be able to call the executable like any old external source with the <script> tag. Your C++ file would look something like this, I believe (parts taken from this thread: http://forums.devshed.com/t109278/s.html):

Code:
#include <iostream>
#include <winsock.h>

int main() {

std::cout << "Content-type: application/x-javascript\n\n";

/* perform actions to check what you want, then use cout to produce a variable with the value true or false which would correspond with the test values */

return 0;

}


Hope that helps!

Happy coding!

Last edited by nolachrymose : January 2nd, 2004 at 07:42 PM.

Reply With Quote
  #10  
Old January 2nd, 2004, 10:50 PM
BenForbes's Avatar
BenForbes BenForbes is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Melbourne - Australia
Posts: 35 BenForbes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I found some code that had the Socket object in it, but I guess it could be a plugin or something.

I can't run server side scripts, so I need a solution that doesn't use cgi, php, asp, jsp, bin, or similar. Any ideas?

Reply With Quote
  #11  
Old January 3rd, 2004, 07:07 AM
nolachrymose nolachrymose is offline
The Forest
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 321 nolachrymose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
I suggested two non-server side methods above..

[edit]The executable solution won't work, because *doh* I forgot executables aren't ASCii, they're machine code. [/edit]

Last edited by nolachrymose : January 3rd, 2004 at 09:21 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Check if FTP server is online, JScript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway