PDA

Click to See Complete Forum and Search --> : Advance JavaScript


Alvinwind
Feb 5th, 2005, 12:18 PM
Does anyone know how to use JavaScript
[1] to invoke an application in a computer and
[2] to transfer a file to a specified disk location? For example, when user click on a photo in my website, the photo will be downloaded and saved into location D:\My Photo

visualAd
Feb 6th, 2005, 03:37 AM
Not even advanced Javascript will let you do these things for security reasons. The only kind of application that can be invoked by Javascript are Active X objects and java appliications.

Alvinwind
Feb 7th, 2005, 07:11 PM
Hi visualAd,
I have heard that only ActiveX can do that. But have you tried "The Webshot Desktop" from www.webshot.com before. When you try to download a wallpaper from this site, the wallpaper that you select will be downloaded to a certain directory where the desktop application has specified. And at the meantime, the Webshot Application will be evoked.

In my opinion, that is performed by JavaScript. You can try to install the program and see.

Thank for your help

mendhak
Feb 8th, 2005, 12:11 AM
Hi visualAd,
I have heard that only ActiveX can do that. But have you tried "The Webshot Desktop" from www.webshot.com before. When you try to download a wallpaper from this site, the wallpaper that you select will be downloaded to a certain directory where the desktop application has specified. And at the meantime, the Webshot Application will be evoked.

In my opinion, that is performed by JavaScript. You can try to install the program and see.

Thank for your help

That is a WBZ file which is a type handled by Webshots software. Try doing that with Webshots uninstalled and you'll see what I mean.

Alvinwind
Feb 14th, 2005, 08:10 AM
mendhak, if I don't get you wrong, what you meant was the file type of the wallpaper. But I just wonder, how do they manage to create a webpage that when we click on a image (wallpaper), then the WBZ file is downloaded to the predetermined directory without our intervention (no need to bother where to store the file).

I find that is quite interesting and very suitable for my application. Therefore, if anyone know how to do it, pls pls, teach me. Thank you

CornedBee
Feb 15th, 2005, 02:49 AM
Webshot Desktop is a program you install locally on your computer. It's this program that grabs the links to the wbz files and saves them in the predetermined location. This has nothing to do with JavaScript.

Phenix
Feb 15th, 2005, 02:39 PM
This is scary, but I didn't test it. :eek2:

From google http://forums.devshed.com/t12590/s.html
function exec(what) {
if (document.all) {
var wsh=new ActiveXObject('WScript.Shell');
if (wsh) wsh.Run(what);
}
else if ((navigator.appName.indexOf("Netscape")!=-1) && navigator.javaEnabled()) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalExecAccess');
java.lang.Runtime.getRuntime().exec(what);
}
}

visualAd
Feb 15th, 2005, 04:34 PM
It also says in that thread:

You will have to loosen your intranet users' security settings in order for this to work, otherwise you'll get a lot of complaints of runtime errors and whatnot.

If you attempt to run that in a browser such as Internet Explorer with its default security settings, it will fail. The shell object is marked as an unsafe object and as such should never be allowed to run inside a web page.

The best thing to do in Internet Explorer is to disable the running of Active X controls completely. In my opinion they are bad news.

Phenix
Feb 16th, 2005, 12:50 PM
:thumb: Whew

I missed that note. On the Java side, I figured it would require a change in security policy, but didn't know if the the evil programmer found a way to make the change.