Delete a file using asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashasprabhu
    New Member
    • Jan 2007
    • 52

    Delete a file using asp.net

    hi,
    how to delete a file using asp.net with vb.net
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Here is an article that may help:
    Reading Text Files in an ASP.NET Web Page

    Comment

    • ashasprabhu
      New Member
      • Jan 2007
      • 52

      #3
      thank you for ur reply,[:)]
      but what i meaned was I want to delete a record and a image file associated with it and stored in server.mappath.
      for ex:
      if i delete a product i should delete the image associated with the product

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Where are you storing the image?

        Comment

        • ashasprabhu
          New Member
          • Jan 2007
          • 52

          #5
          hi,
          im storing it into my project's images folder
          D:\Inetpub\wwwr oot\project\ima ges\xxx.jpg
          and im storing the path as /project/images/xxx.jpg in the database

          Comment

          • chazcross
            New Member
            • Feb 2007
            • 31

            #6
            Query the DB for the record you want to delete
            Get the path to the file from that query
            Delete the record from the DB
            Delete the file from the HD


            Do you need help writing the deletion code for this?

            Comment

            • ashasprabhu
              New Member
              • Jan 2007
              • 52

              #7
              hi,
              thank you for ur help, :)
              As Im a beginner i could not get u.
              please help with a sample code in asp.net with vb so that i could easly undersand
              thank you once again

              Comment

              Working...