HOME > ASP > ASP Forum > ช่วยด้วยค่ะ ไฟล์แรกค่ะ เป็นฟอมร์รับค่ะ iWrong selection : Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. 1 file(s) uploaded.
ช่วยด้วยค่ะ ไฟล์แรกค่ะ เป็นฟอมร์รับค่ะ iWrong selection : Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. 1 file(s) uploaded.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Smart Upload</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<%
fid = Request.QueryString("fid")
act = Request.QueryString("act")
if act = "" Then act = "file"
If CStr(act) = CStr("file") Then
formaction = "upfile_s.asp"
piccolor = "#666666"
filecolor = "#FF0000"
End If
filecount = Request.QueryString("filecount")
If filecount = "" Then filecount = 0
If CInt(filecount) < CInt(1) or CInt(filecount) > CInt(5) Then filecount = 1
' Variables
' *********
Dim mySmartUpload
Dim intCount
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "rar,zip"
' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp"
' Only allow files smaller than 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 5242880
' Deny upload if the total fila size is greater than 200000 bytes
' ***************************************************************
mySmartUpload.TotalMaxFileSize = 5242880
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateFolder (Server.Mappath("upfile/"& foldername))
set f=nothing
set fs=nothing
strconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db/upload.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn
Set rs=Server.CreateObject("ADODB.Recordset")
Sql="Select * From upload"
rs.Open Sql,Conn,1,3
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Save the files with his original names in a virtual path of the web server
' ****************************************************************************
file.SaveAs("upfile/" & foldername &"/" & file.FileName)
rs.AddNew
ID = rs("ID")
fid = hashencode(ID)
rs("fid") = fid
rs("filename") = file.FileName
rs("filedesc") = filedesc
rs("update") = date
rs("uptime") = time
strconn ="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db/upload.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn
Set rs=Server.CreateObject("ADODB.Recordset")
Sql="Select * From upload"
rs.Open Sql,Conn,1,3
fl = 0
While Not rs.EOF and fl = 0
If CStr(rs("fid")) = CStr(fid) Then
filename = rs("filename")
filedesc = rs("filedesc")
If CInt(hcd) = CInt(0) Then rs("dlcount") = CLng(rs("dlcount")+1)
dlcount = rs("dlcount")
rs.Update
fl = 1
End If
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
conn.close
Set Conn = Nothing
%>
<% If CInt(hcd) = CInt(0) Then %>
<Script LANGUAGE="JavaScript">
<!-- Begin
var start=new Date();
start=Date.parse(start)/1000;
var counts=10;
function CountDown(){
var now=new Date();
now=Date.parse(now)/1000;
var x=parseInt(counts-(now-start),10);
if(document.form1){document.form1.clock.value = x;}
if(x>0){
timerID=setTimeout("CountDown()", 100)
}else{
document.form1.btndownload.disabled=false;
}
}
// End -->
</script>
<Script LANGUAGE="JavaScript">
<!--
window.setTimeout('CountDown()',100);
-->
</script>
<% End If %>
Wrong selection : Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
1 file(s) uploaded. Upload path :
file name :
???????? :