ASP copy files and save remote server files

Source: Internet
Author: User


'==============================
' Function name: CopyFiles
' Function: Copy files
' Parameters: File Source address SourcePath, file copied to address Copytopath
'==============================
Function CopyFiles (Sourcepath,copytopath)
Set fso=server.createobject ("Scri" & "Pting"). File "& Sys" & "Temobject")
Fso.copyfile Server.MapPath (SourcePath), Server.MapPath (Copytopath)
Set fso=nothing
End Function

'==============================
' Function name: saveremotefile
' Function: Save remote picture
' Parameters: Image source URL sourceURL, picture save address Savepath
'==============================
Sub Saveremotefile (Sourceurl,savepath)
On Error Resume Next
Set Temp = Server.CreateObject (Mic & Roso "&" ft.) XML "& HT" & "TP"
With Temp
. Open "Get", sourceURL, False, "", ""
. Send
If err.number<>0 Then
Exit Sub
End If
F =. Responsebody
End With
Set Temp = Nothing
Set Objadostream = Server.CreateObject ("A" & "DoD" & "B.st" & "R" & "Eam")
With Objadostream
. Type = 1
. Open
. Write F
. SaveToFile Server.MapPath (Savepath), 2
. Cancel ()
. Close ()
End With
Set objadostream=nothing
End Sub
End Class

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.