Hi Tom
Here is the link to Install AWS Objects in your SalesForce CRM. This will allow you to upload and store files on any object via your SalesForce CRM.
Installing Force for Amazon Web Services - developer.force.com
To Upload files via your website, use the Amazon S3 PHP toolkit: Simply upload the file and then write the appropriate information to the AWS Object and desired relationships you've made.
PHP Developer Center
Here is some code I've got to upload 1 file with public access
PHP Code:
require_once ('/aws/sdk.class.php');
require_once ('/aws/config.inc.php');
header("Content-type: text/plain; charset=utf-8");
$s3 = new AmazonS3();
$bucket = 'Yourbucketname';
$fileloc = 'thetempfilenameofyourfile';
$filename = 'yournewfilename.jpg';
if(empty($Option[ACL])){
$Option[ACL]=AmazonS3::ACL_PUBLIC;
}
$exists = $s3->if_bucket_exists($bucket);
while (!$exists){sleep(1);$exists = $s3->if_bucket_exists($bucket);}
$s3->batch()->create_object($bucket, $filename, array(
'fileUpload' => $fileloc
,'acl'=>$Option[ACL]
,'contentType'=> 'image/jpeg'
));
$file_upload_response = $s3->batch()->send();
if ($file_upload_response->areOK())
{
$resp[Response]=$s3->get_object_url($bucket, $filename, '5 minutes') . PHP_EOL . PHP_EOL;
echo $resp[Response];
}
function filter_file_list($arr)
{
return array_values(array_filter(array_map('file_path', $arr)));
}
function file_path($file)
{
return !is_dir($file) ? realpath($file) : null;
}
Let me know if you require further assistance.
Regards,
Adam
Into Joomla! and SalesForce?
Check us out below at
miiWorks - SalesForce Apps, Joomla Extensions, Business Apps, Web Hosting, Domains
Bookmarks