zeer
Registered
- Thread starter
- #1
Hello XENFORO.IR I have my own forum where users upload files and etc, especially as an admin, I will really appreciate it if a user would guide me on how this
I have also done all configurations for my bucket on my config.php
My problem is I use shared hosting and set up of S3cmd it cant be done. I just needed my uploaded data to be deleted automatically from my hosting once i have uploaded a file or a user has uploaded it. only files, profile pictures, and any shared files.
and this is my code
$s3 = function()
{
return new \Aws\S3\S3Client([
'credentials' => [
'key' => '...........................',
'secret' => '..............................................'
],
'region' => '.....................',
'version' => 'latest',
'endpoint' => '..............................'
]);
};
$config['fsAdapters']['data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), '.......................', 'data');
};
PHP:
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://......................................................................./data/' . $externalPath;
};
$config['fsAdapters']['internal-data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), '..........................', 'internal_data');
};
Amazon S3 for XenForo 2.3.0 add-on
I USE DIGITAL OCEAN S3 BUCKETSI have also done all configurations for my bucket on my config.php
My problem is I use shared hosting and set up of S3cmd it cant be done. I just needed my uploaded data to be deleted automatically from my hosting once i have uploaded a file or a user has uploaded it. only files, profile pictures, and any shared files.
and this is my code
$s3 = function()
{
return new \Aws\S3\S3Client([
'credentials' => [
'key' => '...........................',
'secret' => '..............................................'
],
'region' => '.....................',
'version' => 'latest',
'endpoint' => '..............................'
]);
};
$config['fsAdapters']['data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), '.......................', 'data');
};
PHP:
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://......................................................................./data/' . $externalPath;
};
$config['fsAdapters']['internal-data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), '..........................', 'internal_data');
};