<%
'------------------------------------------------------------------------
'-------------------無垠網域:http://www.5inet.net/ ---------------------
'-------------------作者:嘻哈呵嘿 ,webmaster@5inet.net -----------------
'----------遠程擷取內容,並將內容存在本地電腦上,包括任何檔案!----------
'---------------利用xmlhttp和adodb.stream,酷!絕對原創!-----------------
'On Error Resume Next
'Set the content type to the specific type that you are sending.
'Response.ContentType = "IMAGE/JPEG"
'-------------------------------定義輸出格式-----------------------------
Path=request.querystring("p")
sPath = Path
if left(lcase(path),7) <> "http://" then
'-------------如果前面沒有http就是本地檔案,交給LocalFile處理------------
LocalFile(path)
else
'--------------------否則為遠程檔案,交給RemoteFile處理------------------
RemoteFile(Path)
end if
'Response.Write err.Description
sub LocalFile(Path)
'-------------------如果為本地檔案則簡單的跳轉到該頁面-------------------
Response.Redirect Path
End Sub
Sub RemoteFile(sPath)
'-------------------------處理遠程檔案函數------------------------------
FileName = GetFileName(sPath)
'-------------GetFileName為把地址轉換為合格的檔案名稱過程-------------
FileName = Server.MapPath("/UploadFile/Cache/" & FileName)
Set objFso = Server.CreateObject("Scripting.FileSystemObject")
'Response.Write fileName
if objFso.FileExists(FileName) Then
'--------------檢查檔案是否是已經訪問過,如是,則簡單跳轉------------
Response.Redirect "/uploadfile/cache/" & GetFileName(path)