zoukankan      html  css  js  c++  java
  • 保存远程的文件到本地

    <%
    Call SaveRemoteFile("a.gif","
    http://www.a.com.cn/DocumentAdmin/images/control_switch_up.gif")

    '==================================================
    '过程名:SaveRemoteFile
    '作   用:保存远程的文件到本地
    '参   数:LocalFileName ------ 本地文件名
    '参   数:RemoteFileUrl ------ 远程文件URL
    '==================================================
    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
    %>
  • 相关阅读:
    msp430项目编程57
    msp430项目编程56
    msp430项目编程55
    msp430项目编程54
    msp430项目编程53
    msp430项目编程52
    msp430项目编程51
    msp430项目编程50
    msp430项目编程47
    msp430项目编程46
  • 原文地址:https://www.cnblogs.com/see7di/p/2240097.html
Copyright © 2011-2022 走看看