Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > FileExplorer > Amazon S3 FileBrowserContentProvider

Not answered Amazon S3 FileBrowserContentProvider

Feed from this thread
  • Posted on Oct 14, 2009 (permalink)

    Requirements

    RadControls version

    RadControls for ASP.NET AJAX 
    Q3 2009 SP1
    .NET version

    .NET20 & .NET35
    Visual Studio version

    2005/2008
    programming language

    C# / VB.NET
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    Connecting the RadFileExplorer control to the Amazon S3 storage.

    HOW TO USE THE PROVIDER
    The bucket's name is hardcoded. The credentials for accessing Amazon service need to be set to the
     awsAccessKeyId and awsSecretAccessKey read-only properties.

    The paths set to the ViewPaths, DeletePaths and UploadPaths properties follow this logic :
    If we have this bucket : http://bucket.s3.amazonaws.com/, then in the provider, the BUCKET_NAME read-only property needs to be set to "bucket" value. The paths should point to the virtual folders in this bucket.
    Two folders for example :
    • http://bucket.s3.amazonaws.com/folder1
    • http://bucket.s3.amazonaws.com/folder2
    string[] paths = new string[] { "folder1/", "folder2/" };
    RadFileExplorer1.Configuration.ViewPaths = paths;
    RadFileExplorer1.Configuration.DeletePaths = paths;
    RadFileExplorer1.Configuration.UploadPaths = paths;
    RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(S3ContentProvider).AssemblyQualifiedName;

    This C# Library for Amazon S3 is used in the attached project.

    NOTE
    In the earlier versions of the control the CheckDeletePermissions method does not exist and needs to be removed.

    Reply

  • Daniel Frumkin avatar

    Posted on Nov 2, 2009 (permalink)

    wow!  just googled this looking for a solution-  way to go Telerik- always pushing it!.

    Question- is this solution pretty well tested?   any problems?

    Reply

  • Daniel Frumkin avatar

    Posted on Nov 2, 2009 (permalink)

    Any chance you could deploy a CustomFileSystemPRovider.vb file?

    Reply

  • ldc0618 avatar

    Posted on Nov 30, 2009 (permalink)

    This is a great start, but it appears to only support reading S3 files. What about uploading, copying, deleting, etc?

    Thanks!

    Reply

  • Fiko Fiko avatar

    Posted on Dec 2, 2009 (permalink)

    Hello Lane,

    The implemented provider supports all the features - delete, upload, move etc. You are the first that reports such behavior and I am not quite sure what is causing the problems on your case. Could you please provide me with a little bit more information about the behavior in your case? Do you experience any errors?

    I am looking forward to hearing from you.

    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • Duane Faithen avatar

    Posted on Dec 28, 2009 (permalink)

    I want to thank you for putting this together. I think it is going to save me considerable time in my task at hand.

    3 things:
    1. Was one of the above download links supposed to be for a c# version?
    2. Is it possible to retrieve subdirectories on demand instead of on load? I would like to be able to use this against our s3 structure, except we currently have about 10000 documents nested in thousands of folders. It takes several minutes to load this entire structure up front and since our users are typically after just one document at a time it is unnecessary overhead. Just wondering if this is already a capability I am missing before I start modifying the provider. As well, it seemsd like even though it builds the whole structure up fromt, it rebuilds each nodes child structure on demand when you click that node. This seems to really make the up front structure load redundant and unnecessary.  - this only seems an issue with FileExplorerMode.Default
    3. There seems to be a bug in the directory listings when the directoryName has an & in it. Rather than listing that directories children under it, it relists that directories siblings as children underneath it.

    Thanks

    Reply

  • Duane Faithen avatar

    Posted on Dec 28, 2009 (permalink)

    The following seems to fix item 3 I mentioned above.
    In GetDirectories(), change

    string directoryFullPath = VirtualPathUtility.AppendTrailingSlash(realDirectoryPath) + GetDirectoryName(key); 
    to
    string directoryFullPath = VirtualPathUtility.AppendTrailingSlash(realDirectoryPath) + HttpUtility.UrlEncode(GetDirectoryName(key)); 

    I have not completely tested it yet but Im posting it for everyone anyways.

    Reply

  • Fiko Fiko avatar

    Posted on Dec 29, 2009 (permalink)

    Hi Duane,

    In reference to your questions:
    1. I have attached the C# version of the example as well. Thank you for bringing this to our attention.
    2. By design the folders in RadFileExplorer are loaded on demand (the control does not load all folders). When the page is loaded for the first time only the root folders and their first child folders are loaded (if the InitialPath property is not set). When you click on a child folder then the control initiates asynchronous requests and loads the sub-folders of the clicked folder. This approach is used in order to get the first child items of a folder from the S3 store.
      If you have more files in a folder, then the control will load slowly and this is a normal behavior. In order to optimize loading I recommend you apply one of these approach:
      • Set the ExplorerMode property of the RadFileExplorer control to FileTree.
        As you already know, this will improve the loading performance. The reason for this is that the data-binding is done on the server not the client. When the FileExplorerMode.Default is set the client side DataBinding feature of the grid is used, which is slower than the server-side binding.
      • Set AllowPaging="true" property in order to turn on paging in the grid. In this case only 100 (this is the default value and cannot be changed) items will be shown in the grid.
    3. The problem comes from the fact that the used library's converts the paths in a format that is URL encoded (you can check the result of the StreamResponseToXmlDocument method). Indeed, the solution is to use the approach from your last post.

    I hope this helps.


    Sincerely yours,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • Duane Faithen avatar

    Posted on Dec 29, 2009 (permalink)

    Thanks for your response Fiko.
    In your # 2 comments you mentioned "if the initalpath property is not set." I cant seem to set this when accessing an s3 instance because it doesnt allow relative paths. How would I go about setting this when using the s3 provider?

    Also another problem I seem to be having. In the file explorer itself my credentials work and all seems well, but when I try to open a file I am getting the error "The request signature we calculated does not match the signature you provided. Check your key and signing method." I am using exactly the same credentials in the contentprovider and in the filesystemhandler, yet one works and one doesnt. Has anyone else encountered this?

    Thanks

    Reply

  • Fiko Fiko avatar

    Posted on Jan 4, 2010 (permalink)

    Hello Duane,

    I am not quite sure what is causing the problems on your side. For example this setting works and the value passed to the InitialPath property is applied correctly:
    string[] viewPaths = new string[] { "testFolder1/", "testFolder2/" };
    string[] deleteUploadPaths = new string[] { "testFolder1/NewFolder/Folder_2" };
    RadFileExplorer1.Configuration.ViewPaths = viewPaths;
    RadFileExplorer1.Configuration.DeletePaths = deleteUploadPaths;
    RadFileExplorer1.Configuration.UploadPaths = deleteUploadPaths;
    RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(S3ContentProvider).AssemblyQualifiedName;
     
    RadFileExplorer1.InitialPath = "testFolder1/NewFolder/Flower333.jpg"

    After the page is loaded for the first time, the Flower333.jpg file becomes the selected file.
    The second issue can be caused by the fact that the BUCKET_NAME is not specified in the ASHX handler. Also I recommend you copy (again) the awsAccessKeyId and awsSecretAccessKey values used in the content provider to the ASHX handler as well.

    I hope this helps.

    Regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

    Reply

  • tomas avatar

    Posted on Jan 31, 2010 (permalink)

    This is a great solution however I seem to be having one small problem. The Delete Directory does not seem to be working from the Toolbar. There is no postback or events fired when a directory is selected and delete is clicked from the toolbar. I can however delete the directory from the context menu.

    Any suggestions?

    Reply

  • Fiko Fiko avatar

    Posted on Feb 3, 2010 (permalink)

    Hi Tomas,

    The described problem does not exists in the attached (to the code library) example projects. Could you please modify one of them (C# or VB.NET), open a new support ticket and send it to me? I will check it and do my best to provide a working solution as soon as possible.


    Kind regards,
    Fiko
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.

    Reply

  • Joshua Holmes avatar

    Posted on Mar 24, 2010 (permalink)

    The S3 Content Provider is great, however, I am using RackSpace CloudFiles (Mosso), and I understand there is no pre-made Provider for CloudFiles, so I am creating one.. However it would be REALLLY great to provide a blank provider solution.

    Basically all NonImplemented methods that we can implement our selves rather then having to download the S3 provider and tearing all kinds of junk out of it that we don't need or that is S3 specific, because there is a lot... A simple outlined file with the mandatory methods that RadFileExplorer will utilize and then we can decide how that should be implemented..

    Thanks!

    Reply

  • Lini Lini admin's avatar

    Posted on Mar 25, 2010 (permalink)

    Hello,

    We have an article on how to create a content provider in our documentation - http://www.telerik.com/help/aspnet-ajax/radfileexplorer-custom-filebrowsercontentprovider.html.

    The first article explains how to subclass an existing provider (if you need only a slightly different behavior), while the second part shows how to create an empty provider from scratch.

    All the best,
    Lini
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • John Hamman avatar

    Posted on Apr 28, 2010 (permalink)

    Great provider!

    One issue I can't seem to wrap my mind around yet.

    when I click on a file to download it, it trys to download the provider.ashx file.

    I did make one change to the coding which is I changed the file name and extension from S3FileSystemHandler.ashx
    to S3FileSystemHandler.jsx.
    I have the jsx extension mapped to run as .ashx and works fine with other hanlders that are renamed.
    Can someone help me understand why its trying to download the hanlder file and not the real file?
    John

    Reply

  • Fiko Fiko avatar

    Posted on Apr 30, 2010 (permalink)

    Hello John,

    I am not quite sure what is causing the problem on your side. By default the .ashx files are handled by the ASP.NET framework and these files are not opened for download. Could you please test the same project on a different machine? Also, for testing purposes, I recommend you to remove all Telerik controls from the page and check whether the problem persists. If the problem disappears, could you please open a new support ticket and send me the project which reproduces the problem (including web.config as well)? I will check it and do my best to provide a working solution as soon as possible.


    Sincerely yours,
    Fiko
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Glenn avatar

    Posted on May 25, 2010 (permalink)

    I was so glad to find this post. I tried the sample code with no changes (except ID's and bucket name). I don't see any subdirectories. I understand the concept that there are no folders in s3 but I was hoping that this control did that work for me. Should I be seeing subdirectories? Thanks in advance.

    Reply

  • Fiko Fiko avatar

    Posted on May 28, 2010 (permalink)

    Hi Glenn,

    The code works and I am not sure what is causing the problem on your side. Could you please make sure that you set correct paths and credentials, as described in the description of the codelibrary?

    Regards,
    Fiko
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Alankar avatar

    Posted on Feb 11, 2011 (permalink)

    Hi All,
    I am Alankar srivastava.
    I have currently used ASp.net with c#
    I need a sample code of follwoing featues:
    1. Upload
    2. Download
    3. Delete bucket
    4. Delete File

    Thanks in advance
    Alankar Srivastava

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > FileExplorer > Amazon S3 FileBrowserContentProvider