How do i open an attachment using the runtime environment exec()command. The attachment is currently stored in a DataHandler fileHolders[].
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, March 5, 2002 02:19 PM

I have all the attachments stored in:
DataHandler fileHolders[];

How do i extract the required details of the attachment from the DataHandler, so that I can run the attachment using the Runtime environment exec() command.

Re: How do i open an attachment using the runtime environment exec()command. The attachment is currently stored in a DataHandler fileHolders[].

Posted By:   suzette_quinton  
Posted On:   Saturday, March 9, 2002 08:14 PM

function exec (command) {
if (document.layers && navigator.javaEnabled()) {
window._command = command;
window.oldOnError = window.onerror;
window.onerror = function (err) {
if (err.indexOf ("User didn't grant") != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
}
netscape.security.PrivilegeManager.enablePrivilege
('UniversalExecAccess');
java.lang.Runtime.getRuntime().exec(command);
window.onerror = window.oldOnError;
}
else if (document.all) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh)
wsh.Run(command);
window.onerror = window.oldOnError;
}
}

opening any file would be just using the exec(command).
About | Sitemap | Contact