Skip to Content

Delete excel file from server

Hi All

I am using the JXL API for uploading Excel File into the WD JAVA application. For this, I have to upload the file from Client machine on Server and then create Workbook out of it.

Link to Wiki that I referred is here.

http://wiki.scn.sap.com/wiki/display/WDJava/Uploading+excel+file+using+WebDynpro+for+Java

It is working correctly. However the problem I am facing is that all those files that are uploaded to the server, need to be deleted manually by Administrator. Is there any way we can delete the uploaded file programmatically in the application itself?

Thanx

Deepak Salokhe.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 02, 2014 at 08:25 AM

    Hi,

    When you uploaded the file you save it on the file system

    You can delete it by using the 'delete' method of the 'File' class (this is pure java).

    http://docs.oracle.com/javase/7/docs/api/java/io/File.html#delete()

    File file = new File("myfilepath");
    boolean b = file.delete();

    *** Pay attention that you delete the correct file ***

    Regards,
    Omri

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.