C++ Upload to Amazon S3
Here’s an example of uploading a file via a POST to Amazon S3: void TestPostAmazonS3Upload(void) { CkHttpRequest req; CkHttp http; bool success; // Any string unlocks the component for the 1st 30-days. success = http.UnlockComponent(“Anything”); if (success != true) { printf(“%s\n”,http.lastErrorText()); return; } req.SetFromUrl(“http://something.s3.amazonaws.com/”); req.UseUpload(); req.AddParam(“key”,”file1005.dat”); req.AddParam(“AWSAccessKeyId”,”AA6SXJPBBBBGSZHEJ6ZZ”); req.AddParam(“acl”,”private”); req.AddParam(“success_action_redirect”,”http://www.something.com/blahblah.php”); req.AddParam(“policy”,”abcdefhijmF0aW9uIjogIjIwMDktMTItMDFUMTI6MDA6MDAuMDAwWiIsImNvbmRpdGlvbnMiOiBbeyJidWNrZXQiOiAidHlwaG9vbmRyaXZlIn0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIiXSx7ImFjbCI6ICJwcml2YXRlIn0seyJzdWNjZXNzX2FjdGlvbl9yZWRpcmVjdCI6ICJodHRwOi8vd3d3LnR5cGhvb250b29scy5jb20vdHlwaG9vbmRyaXZlc3RvcC5waHAifSxbInN0YXJ0cy13aXRoIiwiJENvbnRlbnQtVHlwZSIsIiJdXX0=”); req.AddParam(“signature”,”abcdefwFQPpsAAAuCUY2m7g/kkw=”); req.AddParam(“Content-Type”,”application/octet-stream”); // The file must be added last for […]