I am attempting to check to see if a file exists in a child uploads directory from the parent directory the script is in however the script does not seem to want to create a new object. I run into an issue on var fso = new. Any suggestions? How would I get this to work? Is there a better or easier way to delete a file if it exists? Thanks for any help. <script language="JavaScript"> <!-- function delfile() { var readfile="<?php=$readfile?>"; var fso = new ActiveXObject("Scripting.FileSystemObject"); fileBool = fso.FileExists("uploads/" + readfile); if(fileBool) { document.write("Test-fileBool"); fso.DeleteFile("uploads/" + readfile,true); } } //--> </script> Code (markup):
Nevermind, I asked in another forum and found out this is JScript, not JavaScript and it will only work in IE. That being the case, I am looking for a different method. It also uses ActiveX apparently and in IE7 there is a setting to turn ActiveX on or off.