Introduction
Amazon has provided C++ SDK for uploading files to S3 for which you need VS2013. I had made a library project for uploading file to Amazon S3 cloud for Visual Studio 2010 and above using lib CURL. You can use as a .lib or DLL in your project.
Background
Currently, Amazon has provided C++ SDK for Visual Studio 2013. I have made lib for uploading files to Amazon S3 using LIB Curl in Visual Studio 2010. You can extend/modify the library to create, delete , get list of bucket and downloading the file for your Amazon account.
Using the Code
You need to include AmazonS3Upload.h header file and .lib/DLL in your project.
All you need is to provide the below details:
string FilePathToUpload = "c:\songs.mp3";
string bucketName = "mybucket";
string regionUrlPart = "us-east-1";
string FilePathAtAmazon = "foldername\";
string contentType = "media/mpeg";
string strAccesskey = "adasdafas234324";
string strSecretKey = "fgfwt2t2ttertert";
// Use this method to set parameter
pCloudUploadInterface->InitParamenters(FilePathToUpload, bucketName,
REGION_US_SA_EAST_1, FilePathAtAmazon, contentType, strAccesskey, strSecretKey);
//To upload file just call the UploadFile().
int eErrorCode = pCloudUploadInterface->UploadFile();
If ErrorCode 0
means success and other for failure.
On error, you need to call (pCloudUploadInterface->getError())
) to get last error details.
This is just an example to upload your files.
You can modify S3Sdk
project according to your requirement like getting list of bucket, creating, deleting bucket,setting permission to bucket and downloading file from bucket.
Note: Compile in release mode only.