How do i show all the contents of a folder

Source: Internet
Author: User
Tags object ftp
We are in the management of a station, usually upload a lot of files, such as pictures or compressed packets, and so on, how to not through FTP, and so on, and directly in the Web page can view all the content under a folder?

We are in the management of a station, usually upload a lot of files, such as pictures or compressed packets, and so on, how to not through FTP, and so on, and directly in the Web page can view all the content under a folder?

<%
' Create a case of a FileSystemObject object
Set myfileobject=server.createobject ("Scripting.FileSystemObject")
Path=server.mappath ("./folder") ' current directory of folder folders directory
' Create a Folder object
Set Myfolder=myfileobject.getfolder (PATH)
For each thing in Myfolder.subfolders ' get subfolders
Response.Write "<p> directory:" &thing
' Myfileobject.deletefolder thing delete folder, pay attention to using
Next
' Loop over the file
For each thing in Myfolder.files
Response.Write ("<p> file:" &thing) ' Output file path
' Myfileobject.deletefile thing ' Delete these files, this deletion is not recoverable, need to be used carefully
Next
%>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.