How to add a working aws S3 virtualpath provider for EpiServer pagefiles?

戏子无情 提交于 2019-12-11 04:37:49

问题


I'm running a EpiServer project where i want to take use of Amazon S3, to host images, etc... there will be alot of images that will exist from the pagefiles directory.

I've downloaded NuGet for Visual Studio and added the AWSSDK and Geta.AmazonS3 libraries to be able to add Amazon S3 as virtual path provider.

I added this line to EpiServer.config:

<add showInFileManager="true" virtualName="AWS Global Files" virtualPath="~/AWS-S3/" bucketName="s3bucket" verticalDir="CS" bypassAccessCheck="true" hostName="xxxxxxxxx.cloudfront.net" maxVersions="5" name="AWSSiteGlobalFiles" type="Geta.AmazonS3.Hosting.AmazonS3VirtualPathProvider,Geta.AmazonS3" awsAccessKey="xxxxxxxxxxxxx" awsSecretKey="xxxxxxxxxxxxxxxx" physicalPath="" />

And it works fine for global files.

But when i try to add the same for pagefiles i get the message:

"The VirtualPathProvider configured to handle page files must return directories that implement IPageDirectory".

<siteSettings
enableScheduler="true"
 pageFolderVirtualPathProvider="AWSSitePageFiles" />

<add showInFileManager="true" virtualName="AWS Page Files" virtualPath="~/AWS-S3/" bucketName="bucketpage" name="AWSSitePageFiles" verticalDir="CS" bypassAccessCheck="true" hostName="xxxxxxx.cloudfront.net" maxVersions="5" type="Geta.AmazonS3.Hosting.AmazonS3VirtualPathProvider,Geta.AmazonS3" awsAccessKey="xxxxxxxxxxxxxxxxxxx" awsSecretKey="xxxxxxxxxxxxx" physicalPath="" />

Anyone have an idea of what could be wrong, or what needs to be done?

By looking at the library it looks like it implements IPageDirectory (Or at least Unified File System). Geta.AmazonS3 Library

来源:https://stackoverflow.com/questions/14147288/how-to-add-a-working-aws-s3-virtualpath-provider-for-episerver-pagefiles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!