최근에 음악 사이트에서 일하고 있습니다. 음악 파일입니다. . . 일반적으로 인터넷에서 수집됩니다. . 그래서. . 수집 절차가 작성되었습니다.
코드 사본은 다음과 같습니다.
<%
onerrorresumenext
constuploadpath = "/uploads/" '파일 스토리지 경로
constallowfileext = "jpg, wma, swf, gif" '는 파일 유형을 수집 할 수있었습니다
'constallowfilesize = "200"
functiongetFile (URL)
ifurl = ""그런 다음
종료 기능
또 다른
url = trim (url)
endif
'파일을 얻으십시오
fileExt = lcase (mid (url, instrev (url, ".))+1) '파일 유형
filename = lcase (mid (url, instrev (url, "/")+1, instrev (url, ".")-instrev (url, "/")-1)) '파일 유형 파일 이름 없음
NewFilePath = getNow ( "date") & "_"& replace (formatdateMe (now (now (), 3), ":", "") & "_"& cleanfilename (filename) & "."& FileExt
ifinstr ( ","& lcase (allowfileext) & ",", ",", ","& fileext & ",") = 0then
getFile = "파일 유형 허용되지 않음"
종료 기능
endif
setxmlhttp = server.createobject ( "microsoft.xmlhttp")
xmlhttp.open "get", url, false
xmlhttp.send
'whilexmlhttp.readystate <> 4
'XMLHTTP.WAITFORRESPONSE1000
'향하게 하다
ifxmlhttp.status <> 200then
getFile = "오류 가져 오기 파일"
종료 기능
또 다른
setfolder = server.createobject ( "scripting.filesystemobject")
DimfolderName
FolderName = getNow ( "Year") & getNow ( "Month") '폴더
ifffolder.dolerexists (Server.mappath (UploadPath)) = falsethen
folder.createfolderserver.mappath (업로드 포트)
endif
ifffolder.dolerexists (Server.mappath (UploadPath & FolderName)) = falsethen
Folder.createFolderServer.MAPPATH (업로드 경로 및 폴더 이름)