How to delete uploaded file.
-
Hi All !!! I've one image control which displays banner for a shop. On ImageButton- 'Remove Banner', I want to remove that banner image from that image control and from server. Waiting for answer. Thanking You.
OnClick event write below code, set ImageButton.imageUrl path either nothing or defaultimage url it's simple
Parwej Ahamad
-
OnClick event write below code, set ImageButton.imageUrl path either nothing or defaultimage url it's simple
Parwej Ahamad
-
Thanks for replying. But I think you've not understood my question. I want to delete image file which I've uploaded on server. Just I'm using imageButton. I don't want to remove image of imageButton. If u know pls do tell.
string delpath = "C:\Inetpub\wwwroot\projects\images\image1.gif"//complete physicalpath of your image if (File.Exists(delpath)) { File.Delete(delpath); } This will delete the file physically from the server... Suman Singh
-
string delpath = "C:\Inetpub\wwwroot\projects\images\image1.gif"//complete physicalpath of your image if (File.Exists(delpath)) { File.Delete(delpath); } This will delete the file physically from the server... Suman Singh
-
Thanks for replying. But I think you've not understood my question. I want to delete image file which I've uploaded on server. Just I'm using imageButton. I don't want to remove image of imageButton. If u know pls do tell.
ok, when you are upload file to the server your should define the any specific map path and then check if exist then delete otherwise leave it.
Parwej Ahamad
-
ok, when you are upload file to the server your should define the any specific map path and then check if exist then delete otherwise leave it.
Parwej Ahamad