hello

please i need help, am writing a project to check if a particular folder exist in client system , if not let it create it, but if found let it delet it from client side immediately the client visit the site. i try this on my localhost it work very well but when i host the jsp file it fail to work, please help

sample code

<%@page import="java.io.File"%>
<%

File s= new File("c://sec");

        if(s.exists()){
        s.delete();
          out.println("sucker enable, boss");
        }else{
            out.println("no sucker checker found");

        }

%>

of course it fails. servlets (and jsp's are compiled into servlets) run on the server side, not on the client side.

Next to that: I very much doubt what you are trying is possible. It would cause quite some security concerns if it did.

It would cause quite some security concerns if it did.

Indeed. Do you really think browsers and users will have zero protection against some random web site deleting their files so easily? You need to re-think your application design to avoid the need to do this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.