|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
That link does not work, could you check it's validity?
|
|
#4
|
||||
|
||||
|
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... |
|
#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?
|
|
#6
|
||||
|
||||
|
|
|
#7
|
||||
|
||||
|
Thanks, but that is PHP not JavaScript. However I will search a JavaScript reference for the equivalent objects and functions.
|
|
#8
|
||||
|
||||
|
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>
|
|
#9
|
|||
|
|||
|
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. |
|
#10
|
||||
|
||||
|
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? |
|
#11
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Check if FTP server is online, JScript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|