You need to sign in to do that
Don't have an account?
Jamie Thompson
How to move files from Salesforce to Amazon S3?
Hello everyone!
I am using Salesforce Community to develop a mobile application. I want to store files (file feeds) into Amazon S3 instead of Salesforce. Does anyone know how to do that? Any help would be much appreciated.
I am using Salesforce Community to develop a mobile application. I want to store files (file feeds) into Amazon S3 instead of Salesforce. Does anyone know how to do that? Any help would be much appreciated.
Yes, I want to save Chatter Files on a 3rd party rather than Salesforce. The files will not be on SF.
Attach file related to any Salesforce object on Amazon.
Ulimited free storage for one year.
Multiple file uplaod.
No file size limit for upload.
File access control capabiliy.
Track file downloads by users.
File exlorer capability.
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000CW1OXEA1
Here is our email address. Let us know if you have any query.
support@neiloncloud.com
Thanks.
String today = Datetime.now().format('dd-MM-yyyy');
Blob csvBlob = blob.valueOf(csvFile );
// Blob csvBlob= EncodingUtil.base64Decode(csvFile);
String csvName = ObjectLabelName+' Data as on '+today+'.csv';
string filename,filetype='';
String Sdate = Datetime.now().formatGMT('EEE, dd MMM yyyy HH:mm:ss z');
filename=ObjectLabelName +'.csv';
//setup variables
String formattedDateString = Datetime.now().format('EEE, dd MMM yyyy HH:mm:ss z','America/Denver'); //this is needed for the PUT operation and the generation of the signature. I use my local time zone.
String bucketname='datadrchiving/test';
String method='PUT';
String contentType = 'text/csv';
HttpRequest req = new HttpRequest();
req.setMethod(method);
req.setHeader('Host','s3.console.aws.amazon.com');
req.setEndpoint('https://s3.console.aws.amazon.com/s3'+'/'+'buckets'+'/'+bucketname);//+'/'+filename
req.setHeader('Content-Length', string.valueOf(csvFile.length()));
req.setHeader('Content-Type', contentType);
req.setHeader('Content-Encoding','base64');
req.setHeader('Date', formattedDateString);
req.setHeader('ACL', 'public-read-write');
String stringToSign = 'PUT\n\n' + formattedDateString + '\n\n' + '/' + bucketname + '/' + filename;
// String signed = createSignature(stringToSign,secret);
// String authHeader = 'AWS' + ' ' + key + ':' + signed;
string authHeader=createAuthHeader(method,contentType,filename,formattedDateString,bucketname,key,secret);
system.debug('Auth header***');
system.debug(authHeader);
req.setHeader('Authorization',authHeader);
system.debug('blob value***'+csvBlob);
req.setBodyAsBlob(csvBlob);
Http http = new Http();
try
{
//Execute web service call
HTTPResponse res = http.send(req);
System.debug('RESPONSE STRING: ' + res.toString());
System.debug('RESPONSE STATUS: '+res.getStatus());
System.debug('STATUS_CODE: '+res.getStatusCode());
}
catch(System.CalloutException e)
{
system.debug('AWS Service Callout Exception: ' + e.getMessage());
}
Response is coming 200 ok from AWS server but unable to find the CSV in aws account. Could you please check and help on this.
The service is totally no coding and has flexible scheduling features.
Please have look:https://sforce.co/34y12sL