cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Delete excel file from server

Former Member
0 Likes
342

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Likes

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