Recommended: Asp component-free upload with real progress bar Asp component-free upload with real progress bar without component-free upload with real progress bar, where upload.asp is the core code. Unless you need to special needs, demo.htm is a demonstration without refresh progress bar (IE5.5+ support). demo.asp is a file uploaded by demo.asp. Because the demo requires it, it is only uploaded in Demo.asp and does not save it. If you need to save it, you only need to remove the relevant
<%
Function SaveRemoteFile(LocalFileName,RemoteFileUrl)
SaveRemoteFile=True
dim Ads, Retrieval, GetRemoteData
Set Retrieval = Server.CreateObject(Microsoft.XMLHTTP)
With Retrieval
.Open Get, RemoteFileUrl, False, ,
.Send
If .Readystate<>4 then
SaveRemoteFile=False
Exit Function
End If
GetRemoteData = .ResponseBody
End With
Set Retrieval = Nothing
Set Ads = Server.CreateObject(Adodb.Stream)
With Ads
.Type = 1
.Open
.Write GetRemoteData
.SaveToFile server.MapPath(LocalFileName),2
.Cancel()
.Close()
End With
Set Ads=nothing
End Function
%>
<%
'The following is a call example:
remoteurl=http://www.uyux.cn/logo.gif'Remote file name (absolute full path)
localfile=Replace(Replace(Replace(Now(),-,),),),:,)&Right(remoteurl,4)'Native file name (customizable)
If SaveRemoteFile(localfile,remoteurl)=True Then
Response.Write (save successfully: &localfile)
End If
%>
-
Share: ASP realizes static refresh-free paging effect #FormatTableID_0# html head title news list simplified/title script language=javascript !-- //ajax control can also be made into a separate file to facilitate calling function Ajax() { var xhrObj=null; if(window.XMLHttpRequest) { xhrObj=new XMLHttpRequest(); } else if(window.ActiveX