I realised that I could have spent the last twenty years putting all my tech knowledge online. Well, I didn't, but as they say, the best time to plant trees is 20 years ago, the second best time is now. So here's all the random programming stuff I've come across that might be helpful. Note: this isn't really questions and answers - more just answers from me!

How to use Chilkat S3_DownloadBytes and S3_UploadBytes to copy images in Classic ASP

0 votes

Copy images between Amazon s3 buckets in memory only using Chilkat's S3_DownloadBytes and S3_UploadBytes. Example classic ASP code. 

Function http_copy_bytes(contentType,bucketSourceName,bucketDestName,objectName,justFileName) 
    Dim success, binaryImage 

    ' Set up chilkat http 
    Dim http : Set http = Server.CreateObject("Chilkat.Http") 
    http.AwsAccessKey = AwsAccessKey ' your key 
    http.AwsSecretKey = AwsSecretKey ' your key 

    ' Download image from source bucket 
    binaryImage = http.S3_DownloadBytes(bucketSourceName,objectName) 

    ' Upload file to destination bucket 
    success = http.S3_UploadBytes(binaryImage,contentType,bucketDestName,lcase(objectName)) 

    If (success < 1) Then 
        Response.Write Server.HTMLEncode( http.LastErrorText) 
        Response.Write Server.HTMLEncode( "File uploaded.") 
    End If 
    Set http = Nothing 
End Function 

asked Mar 8, 2018 in Classic ASP by Ralpharama (380 points)

Please log in or register to answer this question.