Hi!
I have tried to create an applet which is able to access the clients file system.
The applet should be able to check the size of a file before uploading it. Therefore it should be able to be accessd via LiveConnect (javascript)...
The problem I have is that I a com.ms.security.SecurityExceptionEx[Unknown] is thrown when I try to access the file.
ps: the applet is signed with a valid signature
Everytime I call the function below with javascript I get the following error:
I have tried to create an applet which is able to access the clients file system.
The applet should be able to check the size of a file before uploading it. Therefore it should be able to be accessd via LiveConnect (javascript)...
The problem I have is that I a com.ms.security.SecurityExceptionEx[Unknown] is thrown when I try to access the file.
ps: the applet is signed with a valid signature
Everytime I call the function below with javascript I get the following error:
Code:
com.ms.security.SecurityExceptionEx[Unknown]: cannot access file C:\wsinst.log
at com/ms/security/permissions/FileIOPermission.check
at com/ms/security/PolicyEngine.deepCheck
at com/ms/security/PolicyEngine.checkPermission
at com/ms/security/StandardSecurityManager.chk
at com/ms/security/StandardSecurityManager.checkRead
at java/io/File.exists
at CheckFileSize.setFile
Code:
public String setFile(String filePath)
{
try
{ Class.forName("com.ms.security.PolicyEngine"); // throws ClassNotFoundException
PolicyEngine.assertPermission(PermissionID.FILEIO);
}
catch (ClassNotFoundException cnfe)
{
// ignore
}
catch (Exception x)
{ x.printStackTrace ();
}
catch (Error e)
{ e.printStackTrace ();
}
this.f = new File(filePath);
if (!f.exists())
{
errMsg = "File \"" + f.getName() + "\" does not exist";
repaint();
return errMsg;
}
else if (!f.canRead())
{
errMsg = "Problems appeared reading the file";
repaint();
return errMsg;
}
try
{
setImageInfo(new FileInputStream(f));
}
catch (FileNotFoundException e)
{
errMsg = "File \"" + f.getName() + "\"not Found";
repaint();
return errMsg;
}
return "file \"" + f.getName() + "\" loaded successfully";
}