濮阳杆衣贸易有限公司

主頁 > 知識庫 > asp讀取遠(yuǎn)程文件并保存到本地代碼

asp讀取遠(yuǎn)程文件并保存到本地代碼

熱門標(biāo)簽:咸陽銷售外呼系統(tǒng) 企數(shù)外呼系統(tǒng)能用多久 為什么外呼系統(tǒng)需要預(yù)存話費呢 蘭州智能語音電銷機(jī)器人功能 辦理400電話一年多少錢 常用地圖標(biāo)注范圍點 離線電子地圖標(biāo)注軟件注冊 寧夏怎么申請400電話 外呼回?fù)芟到y(tǒng)圖片
%
dim act,ifLogin,loginUrl,loginActUrl,loginData,fileUrl,fileName
act=request.QueryString("act")
if(act="do") then 
 ifLogin=Cint(request.QueryString("ifLogin"))
 loginActUrl=request.Form("loginActUrl")
 loginData=request.Form("loginData")
 fileUrl=request.Form("fileUrl")
 fileName=mid(fileUrl,instrrev(fileUrl,"/")+1)
 extPos=instrrev(fileName,"?")
 if(extPos>0) then
  fileName=left(fileName,extPos-1)
 end if
 if(ifLogin=1) then
  call PostHttpPage(loginActUrl,loginData)
 end if
 call DownloadFile(fileUrl,fileName)
else
%>
form name="form1" method="post" action="?act=do">
  p>是否登錄:
    input name="ifLogin" type="radio" value="1">
    是
    input name="ifLogin" type="radio" value="0" checked>
    否  /p>
  p>登錄提交地址:
    input name="loginActUrl" type="text" size="50">
  /p>
  p>
    登錄數(shù)據(jù):input name="loginData" type="text" size="50">
  /p>
  p>
    要保存的遠(yuǎn)程文件URL:
    input name="fileUrl" type="text" size="50">
  /p>
  p>
    input type="submit" name="Submit" value="提交">
    input type="reset" name="Submit2" value="重寫">
  /p>
/form>
%
end if
Function BytesToBstr(body,code) 
        dim objstream 
        set objstream = Server.CreateObject("adodb.stream") 
        objstream.Type = 1 
        objstream.Mode =3 
        objstream.Open 
        objstream.Write body 
        objstream.Position = 0 
        objstream.Type = 2 
        objstream.Charset =code
        BytesToBstr = objstream.ReadText  
        objstream.Close 
        set objstream = nothing 
End Function 
Function PostHttpPage(loginActUrl,PostData) 
    Dim xmlHttp 
    Dim RetStr      
    Set xmlHttp = CreateObject("Microsoft.XMLHTTP")  
    xmlHttp.Open "POST", loginActUrl, False
    XmlHTTP.setRequestHeader "Content-Length",Len(PostData) 
    xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"   
    xmlHttp.Send PostData 
    If Err.Number > 0 Then 
        Set xmlHttp=Nothing
  response.Write("提交登錄時出錯!提交數(shù)據(jù):"PostData)
        Exit Function
    End If
    PostHttpPage=BytesToBstr(xmlHttp.responseBody,"GB2312")
    Set xmlHttp = nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''
function DownloadFile(url,filename)
 Set xml = Server.CreateObject("Msxml2.XMLHTTP") '創(chuàng)建對象

   xml.Open "GET",url,False
   xml.Send '發(fā)送請求    

   if Err.Number>0 then 
  Response.Status="404"
  else
  Response.ContentType="application/octet-stream"
  Response.AddHeader "Content-Disposition:","attachment; filename="  filename
  Range=Mid(Request.ServerVariables("HTTP_RANGE"),7)
  if Range="" then
   Response.BinaryWrite(xml.responseBody)
  else
   S.position=Clng(Split(Range,"-")(0))
   Response.BinaryWrite(xml.responseBody)
  End if
  end if
 Response.End  
   Set xml = Nothing
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''
%>

標(biāo)簽:麗江 昆明 鐵嶺 家電維修 泰州 咸陽 溫州 昌都

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp讀取遠(yuǎn)程文件并保存到本地代碼》,本文關(guān)鍵詞  asp,讀取,遠(yuǎn)程,文件,并,保存,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp讀取遠(yuǎn)程文件并保存到本地代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp讀取遠(yuǎn)程文件并保存到本地代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    黄山市| 库伦旗| 云龙县| 萝北县| 霞浦县| 临武县| 贺兰县| 抚松县| 邢台县| 江孜县| 调兵山市| 黔江区| 淮南市| 嘉义县| 襄樊市| 承德县| 固始县| 恩施市| 高台县| 武鸣县| 将乐县| 武冈市| 锡林浩特市| 富源县| 庄河市| 塔河县| 嫩江县| 庆安县| 新建县| 忻州市| 郑州市| 青海省| 九龙县| 枣庄市| 丽水市| 高雄市| 吉安市| 星座| 深圳市| 长武县| 民和|