=pagesize then
fullname_last=filename&"_"&(n+1)&".csv"
mkfile(fullname_last)
end if
set fso=server.createobject("scripting.filesystemobject")
set a = fso.openTextFile(server.mappath(fullname_last), 8)
a.WriteLine ""&id&","&chr(34)&filebody&chr(34)
a.Close
response.write("publish success")
end if
end if
Function get_file(file_name,temp_id)
set conn=server.createobject("ADODB.Connection")
set rs=server.createobject("ADODB.Recordset")
conn.open "Driver={microsoft text driver (*.txt; *.csv)};dbq="&server.mappath(".")
rs.open "select * from "&file_name,conn,1,1
do while not rs.eof
if temp_id=rs(0)&"" then
get_file=rs(1)
exit do
end if
rs.movenext
loop
conn.Close()
Set rs=Nothing
Set conn=Nothing
End Function
Function get_file_line_count(file_name)
Dim n1
n1=0
set conn=server.createobject("ADODB.Connection")
set rs=server.createobject("ADODB.Recordset")
conn.open "Driver={microsoft text driver (*.txt; *.csv)};dbq="&server.mappath(".")
rs.open "select * from "&file_name,conn,1,1
do while not rs.eof
n1=n1+1
rs.movenext
loop
conn.Close()
Set rs=Nothing
Set conn=Nothing
get_file_line_count=n1
End Function
Function mkfile(file_name)
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath(file_name))=false then
set a = fso.CreateTextFile(server.mappath(file_name), True)
a.WriteLine "id,file"
a.Close
end if
End Function
%>