• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented possibility to choose external cloud storage

#1
Hello,

I think it would be a good idea, to give the administrator in the ACP the chance to choose where the uploaded images are stored.

When the webhoster has limited storage, you may want to host the images on one of the cloud image hoster ;)
Also great would be to link each category with an external cloud hoster.

So you can decide, if category "cars" should store images on the local hdd or if the images should be stored somewhere else and only be linked.

The forum member shouldn`t take note where the images are stored.
For him uploading always feels the same :D

Erich
 
#2
I am realy wondering why nobody from the stuff is commenting this suggestion :eek: even there are some likes.

It is not only the limited space from a Webhoster which makes hosting a gallery very expensive.
Most Webhosters give you an amount of files you can store.
So only with the Xenforo installation plus the plugins I need I reached 1/5th if files I can store.

I am afraid from giving members the right to upload pictures like they want - because then I am forced to invest more money in storing more files.

So when there is no reaction to this suggestion, I would like to hear from other members how are you solving the problem with the limited storage or file count in your Webspace o_O

I know that Xenforo will not build a bridge to all Image Hosters - but it would be fine to get the core.
Then we, the users, can develope the connection to a specific hoster, if the API already is implemented.

Erich
 

Chris D

XenForo developer
Staff member
#4
This is now implemented via XF2's abstracted file system.

It isn't a specific gallery option, but XF2 supports using cloud storage providers (though these additional providers would likely need to come via an add-on).
 

Sim

Well-known member
#7
Are there any plans to provide 1st party implementations of popular cloud storage providers (eg S3 / Rackspace) ?

As useful as the flexibility is, I'd rather not be relying on 3rd party addons for such critical functionality.

Even if there were just one or two options provided, that then gives us a "default" option we can choose to use - if we then choose to use a 3rd party option which subsequently becomes unusable due to lack of updates, we can always fall back on those default options.

How much work is involved in implementing one of the existing flysystem adapters? Are such addons likely to be fairly trivial to implement or will there be a lot of work to make it all hang together?
 

Chris D

XenForo developer
Staff member
#8
It's worth a separate (XF) suggestion.

No immediate plans, but it would be worthwhile (it could be similar to how our CacheFactory stuff is set up which supports easy (or easier) configuration of the popular cache providers).

To clear something up, though, I wouldn't necessarily be too concerned about this kind of thing being third party. There's very little to go wrong. The extent of the code required (and essentially an advanced user could implement the entire thing in config.php) is basically thing (taking AWS S3 v3 as an example):
PHP:
$config['fsAdapters'] = [
   'data' => function()
   {
      $client = new \Aws\S3\S3Client([
         'credentials' => [
            'key'    => 'ABC',
            'secret' => '123'
         ],
         'region' => 'eu-west-2',
         'version' => 'latest',
      ]);

      return new \League\Flysystem\AwsS3v3\AwsS3Adapter($client, 'a.a.com', 'data');
   }
];

$config['externalDataUrl'] = function($externalPath, $canonical)
{
   return 'https://s3.eu-west-2.amazonaws.com/a.a.com/data/' . $externalPath;
};
The only things an add-on needs to do is:
1) Bring in the relevant Flysystem adapter
2) Bring in the providers client library (if applicable)
3) Provide some sort of configuration (for the most part, you'd just do this in config.php anyway)