delete an uploaded file using upload contol tool ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dev646
    New Member
    • Feb 2009
    • 1

    delete an uploaded file using upload contol tool ?

    hi all ,
    coming to the problem straight away...
    i was trying to find out how new tools,unknown for me works out in asp.net...
    in upload control it worked out pretty well for newbie like me.
    but when del. part came i'm stuck.
    how to do delete , for an uploaded file ?
    how to pop out that window (which allows you to browse and select file for deleting) ?
    which command for finding the path of that file ?

    thanks for looking into this problem...
    if any body wants i can put that code in here, but it's wrong somewhere...
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You are going to have to create an ASP Page or a User Control that displays the files that the person can select for deleting.

    Look into using a GridView to display the files and allow the user to delete them. Look into using the Objects found in the System.IO namespace to help you retrieve file information and delete the files selected.

    -Frinny

    Comment

    • bhupinder
      New Member
      • Feb 2009
      • 32

      #3
      to delete an uploaded file using upload contol tool ?

      Hi
      Firstly you have to checked this file already exist or not.
      after that you can delete files.


      Code:
      If (File.Exists(Server.MapPath("../FolderName/Filename "))) Then
                          File.Delete(Server.MapPath("../FolderName/Filename"))
      End If
      Last edited by Frinavale; Feb 25 '09, 03:44 PM. Reason: Added [code] tags: Please post code between [code][/code] tags

      Comment

      Working...