cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting the Uploaded image

Former Member
0 Kudos

Hi Experts,

I have uploaded the image in the server using File Upload UI.Now i has to delete the image from the server.How to do it ?

Regards,

Krishna Balaji T

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos

Hi

I think you can delete the file from server, for that you need to have administrator privilege,

1. get the file directory

2. check if file exists.

3 . delete the file.

Thanks

Former Member
0 Kudos

Hi Anup Bharti,

Can you please explain the procedure detailly.

Regards,

Krishna Balaji T

former_member192434
Active Contributor
0 Kudos

try to find the server location like

String FileName ="abc"

String directory =".
temp
webdynpro
web
local
yh1245_ftp"+

"
Components
com.yash.yh1245.Upload
"FileNamewdContext.currentContextElement()

then check it exit or not

boolean sucsss1 = new File(directory).exists();

then

File file = new File(directory"
"
wdContext.currentContextElement().getResourceURL().getResourceName().toString());

FilePath = file.getAbsolutePath();

if (file.exists){

file.delete();

}

i hope clear now

thanks

Answers (2)

Answers (2)

former_member197348
Active Contributor
0 Kudos

Hi Krishna,

Perhaps, you can not delete this image through the application. If you have administrator privileges, then try to log in and delete it carefully.

Regards,

Siva

lokesh_kamana
Active Contributor
0 Kudos

Hi,

To delete the file from the server

File f =new File ("<Path pf the file in server >");

f.delete();

Thanks & Regards,

Lokesh