Question

Can I programmatically upload a file to the server (without client's interference) ? I know this is not possible in normal (.html) files. Is there anyway I can do it from .hta file? or any server side or plug-gin solution?

Was it helpful?

Solution

from an HTA, you can use the shell object to run commands just as if you were running from the command line - including FTP - but of course you'll need FTP credentials. since you said you'll be able to hardcode the files to be uploaded, i assume you have full access...

var shell = new ActiveXObject('wscript.shell');
var params = // this should be a string of ftp commands, like OPEN ftp.example.com USER PASS CWD somedir PUT c:\whatever.txt BYE
shell.run("%comspec% /c ftp.exe -i -s:" + params, 1, true);

OTHER TIPS

Short answer is no.

It may be possible on some machines using a signed java applet - but from the wording of the question, that's going to be a very long juorney for you.

Based on your last comment, you might atleast need the user to load a web page. So based on an onload function, you can use an ajax hidden form to submit whatever files that you'd want to.

But getting information from your user without their knowledge might put you in a legal situation.

Good luck!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top