code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| set Folder = FSO.Getfolder("c:\files\new\")
for each objfile in Folder.Files
tmpfilename=objfile.name
tmpfilesize=objfile.size
thefilename=replace(tmpfilename,"'","qoutteken")
thefilename=replace(thefilename,".zip","")
thefilename=replace(thefilename,"_"," ")
if fso.FileExists("c:\files\new\"&tmpfilename) and not fso.FileExists("c:\files\"&tmpfilename) then
fso.MoveFile "c:\files\new\"&tmpfilename, "c:\files\"&tmpfilename
tsql="insert into files (crk_name,crk_filesize) values ('"&thefilename&"','"&tmpfilesize&"')"
call execonn(tsql)
end if
Next
call closeConnection
Response.Write ("Database updated") |