Print Page | Close Window

ASP code to list/delete files in a folder

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=21930
Printed Date: 29 March 2026 at 5:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP code to list/delete files in a folder
Posted By: Jhinuk
Subject: ASP code to list/delete files in a folder
Date Posted: 15 November 2006 at 2:11am
Hi,

I am looking for a code snippet (in classic ASP) that will not only list all the files in s specified folder (I have instances of that), But also create a DELETE button along side the file names (or check boxes beside each file name, with one delete button) so that the files can be removed from the folder,

The file listing part is easy; that can be done with the following code snippet, I think:

Set objFso = CreateObject("Scripting.FileSystemObject")
  Set objFiles = objFso.GetFolder(Server.MapPath("."))
  Set fileList = objFiles.Files
  For Each i in fileList
  response.write i.name & "<br>"
  next


But, my ASP 
strengths are not up to where I can write what I need.  I have all over the web, but cannot seem to locate such a code snippet.  I would be very appreciative if you can help.

Thanks.


-------------
Jhinuk Chowdhury
<jc AT plasticcreations DOT com>
URL: www.plasticcreations.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net