_php tutorial for Implementing server-side files with Xml+fso+js

Source: Internet
Author: User
First create a program on the server side to generate an XML file to return to the client, (getfolder.asp) <% written by Linzhang Chen, 2003-4-20 reprint please specify the source and retain this copyright information Response.Write " "&AMP;CHR (Response.Write)" "&AMP;CHR" Folders=request ("folder") if folders= "/" Then folders= "" End If Dim count count=0 folders=replace (folders, " .. "," ") basefolder=". /media/"Base folder path Newfolder=basefolder&folders Set FSO =server. CreateObject ("Scripting.FileSystemObject") Set F=fso.getfolder (Server.MapPath (NewFolder)) set sf=f.subfolders for Each FD in SF returns the folder list below the specified path Response.Write " "&CHR (Response.Write)" folder "&CHR (Response.Write" "&fd.name&" "&CHR (Response.Write)" "&AMP;CHR" count=count+1 next set sf=nothing set ff=f.files for each fi in FF Fname=fi.name if InStr ("Asf,wma,wmv", Lcas E (Mid (Fname,instrrev (fname, ".") +1))) >0 then set the allowed file types to be returned, preventing the source from leaking Response.Write " "&CHR (Response.Write)" file "&chr Response.Write" " &fname& " &A MP;CHR (Response.Write) " &AMP;CHR Count=count+1 End If Next if there is no file in the directory, send an empty element if Count=0 then Response.Write " "&CHR" Response.Write " Empty " &CHR (Response.Write " 0 " &CHR) resp Onse.write " "&AMP;CHR () End If Response.Write" The set ff=nothing set f=nothing set fso=nothing%> below is the client's JS effort (selectfile.asp) <title>Select a video file</title> Lookup Range ( I): File Type ( T): Streaming media files (*.asf,*.wmv,*.wma) There's a small file in it. Blank.htm used to define the style of file and folder display <title>New Document</title> Call the time with the following function, you can realize the effect of the server-side selection of the file's effects function selectfile () {var arr = ShowModalDialog ("selectfile.asp?temp=" +math.random (), "", "DIALOGWIDTH:453PX; dialogheight:252px; Status:0;help:1 "); if (arr! = null) {return arr}} This function finally returns the selected file name, the function inside the use of a few pictures of the user has been grabbed from the file selection box:) estimated in the use of the process may also encounter a variety of unknown bugs welcome everyone and I exchange: E_Mail: Clzwin@sina.com

http://www.bkjia.com/PHPjc/532141.html www.bkjia.com true http://www.bkjia.com/PHPjc/532141.html techarticle first create a program on the server side to generate an XML file to return to the client, (getfolder.asp) quot; quot;folder) if folders=/then folders= End If Dim count count=0 Fo ...

  • Related Article

    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.