home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
207.233.110.77
/
207.233.110.77.tar
/
207.233.110.77
/
vbasic
/
ProcessUpload.asp
< prev
next >
Wrap
Text File
|
2003-09-18
|
2KB
|
51 lines
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!-- METADATA
TYPE="TypeLib"
FILE="C:\Program Files\Common Files\System\ADO\msado21.tlb"
-->
<!--#include file="Crypt-DeCrypt.asp"-->
<% If Session("ValidatedStudent") <> True Then
Response.Redirect "error.asp?error=denied"
End If %>
<html>
<head>
<title>Successful File Upload</title>
</head>
<body>
<%
Dim strAbsPath 'Absolute Path of active directory -- strRoot & <folder>\<folder> etc.
Dim objFSO 'FileSystemObject
Dim objFolder 'FolderObject
Dim objFile 'FileObject
'The absolute Path of the destination directory.
strAbsPath = Session("upabspath") & "\"
'Create the File System Object
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Create the Folder object (to easily access the folder's files and folders)
Set objFolder = objFSO.GetFolder("c:\vbstudents")
'Copy files found in c:\vbstudents to the user's folder
If objFolder.Files.Count > 0 Then
'Delete any executable files that were uploaded
For Each objFile In objFolder.Files
If InStr(objFile.Name, ".ex_") <> 0 Or _
InStr(objFile.Name, ".ba_") <> 0 Or _
InStr(objFile.Name, ".vb_") <> 0 Or _
InStr(objFile.Name, ".cm_") <> 0 Or _
InStr(objFile.Name, ".co_") <> 0 Then
objFSO.DeleteFile("c:\vbstudents\" & objFile.Name)
End If
Next 'objFile
'Copy the remaining files to the Student's folder
If objFolder.Files.Count > 0 Then
objFSO.CopyFile "c:\vbstudents\*.*", strAbsPath
objFSO.DeleteFile ("c:\vbstudents\*.*")
End If
End If
Set objFolder = Nothing
Set objFSO = Nothing
Response.Redirect ("user.asp?email=" & Session("upemail") & "&action=list&path=" & Crypt(Session("uprelpath")))
%>
</body>
</html>