Bastian, try this. You may have to get the "path" info from your servlet
by using something like using your HttpServletRequest
request.getContextPath(); to get the path for your content path of your
servers file path. I'm sure you know you can't delete file from your
clients' pc. 


public void doPost(HttpServletRequest request, HttpServletResponse
response)
          throws ServletException, IOException{
                                        //doPost(request, response); 
        boolean success = (new File("filename")).delete();
    if (!success) {
        // Deletion failed
    }
}


Tom Kochanowicz
Janitor III
Nebraska Psychiatric Institute






Subject: Delete-File-Servlet


Hello,

i would like to delete some files in a folder on a Server by calling a
servlet.
I know how it works in an application , but how does it work in a
servlet ?

THX
Bastian

--------------------------------------------
Bastian Stöhrer

Mittermaierstr. 23
69115 Heidelberg
Germany

Tel  (+49) 6221 8935844
Fax  (+49) 6201 877461
Mobil(+49)  177 2318647
Mail  [EMAIL PROTECTED]
--------------------------------------------

________________________________________________________________________
___
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

________________________________________________________________________
___
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 9/18/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 9/18/2003
 

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to