Results 1 to 5 of 5
  1. #1
    Historypaul is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    64

    Need PUT/GET and strings for communicating with Amazon S3 API or RESTful API

    So I'm working on my MS Access front end being able to save and retrieve files from cloud-based file storage. It seems most of the "big boys" make themselves compatible with the Amazon S3 API or the RESTful API, so I'm writing some strings to connect with, authenticate, create and delete buckets, save, retrieve and modify objects, and last, but not least, it would be nice to be able to create users for the ACL.

    This is a shameless request for pity code if anyone has already written some of this...

    I have not found any VBA examples ANYWHERE.

    Closest thing I've found is:

    http://stackoverflow.com/questions/3...ul-web-service

    If nobody's done it yet, I'll post what I've written once I get it working...

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You may find some info here.

  3. #3
    Historypaul is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    64
    Well, what I ended up doing was just purchasing a "code bundle" from Chilkat. I ended up using the S3 API instead of the SWIFT API to communicate with the server, and Chilkats pre-bundled activex .dll was just the ticket.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Glad you have it all working. If you have any vba code or comments, I'm sure readers would appreciate it.

  5. #5
    Historypaul is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    64
    I hate to admit it, but there's plenty of code and comments, and none of it's mine. I would really like to see the functions and how they're written, but more for professional enrichment than anything. The procedures I would post wouldn't really make sense as they're based on the objects and methods in the .dll written by Chilkat. It's pleasantly inexpensive, and even when I needed an additional function, I just asked them, they wrote it and added it to their library. I'm able to concentrate on other aspects of the software, which is really nice. I did include a snippet of the sample code they provide below for working with their activeX objects/methods. This one in particular is the procedure for uploading a file to an S3 server like Amazons S3 or any of the other file-share servers using an S3 API.

    I'm probably sounding like a commercial for Chilkat a little, but I haven't really found anyone else publishing up-to-date, useful APIs/helpers in VBA. It's kind of exciting.


    Code:
    Dim http As New ChilkatHttp
    
    Dim success As Long
    success = http.UnlockComponent("Anything for 30-day trial")
    If (success <> 1) Then
        Text1.Text = Text1.Text & http.LastErrorText & vbCrLf
        Exit Sub
    End If
    
    '  Insert your access key here:
    http.AwsAccessKey = "ABQXXABC83ABCDEFVQXX"
    
    '  Insert your secret key here:
    http.AwsSecretKey = "XXXXYYYYabcdABCD12345678xxxxyyyyzzzz"
    
    Dim bucketName As String
    bucketName = "chilkattestbucket"
    
    Dim objectName As String
    objectName = "starfish.jpg"
    
    Dim localFilePath As String
    localFilePath = "starfish.jpg"
    
    Dim contentType As String
    contentType = "image/jpg"
    
    success = http.S3_UploadFile(localFilePath,contentType,bucketName,objectName)
    
    If (success <> 1) Then
        Text1.Text = Text1.Text & http.LastErrorText & vbCrLf
    Else
        Text1.Text = Text1.Text & "File uploaded." & vbCrLf
    End If
    
    

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Communicating data between tables.
    By jasdem in forum Database Design
    Replies: 6
    Last Post: 02-06-2014, 03:18 PM
  2. Replies: 2
    Last Post: 04-23-2013, 12:44 AM
  3. VB Loading DLL and Communicating with Server
    By Baldeagle in forum Programming
    Replies: 6
    Last Post: 01-07-2013, 02:41 PM
  4. Communicating With SQL Server
    By steve2507 in forum Access
    Replies: 6
    Last Post: 02-13-2012, 03:28 PM
  5. Grouping strings
    By Fre in forum Access
    Replies: 16
    Last Post: 04-24-2010, 03:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums