Amazon S3

Amazon Simple Storage Service (Amazon S3) is storage for the internet. You can use Amazon S3 to store and retrieve any amount of data at any time, from anywhere on the web.

The Amazon S3 extension provides an additional file system provider that can be added to the Open File Dialog or Save File Dialog to browse and use files on the cloud.

How to Use

The AmazonS3 component can be added to a Wisej.NET project using NuGet Package Manager.

  • Define a new root for your File Dialog of type Wisej.Web.Ext.FileSystem.S3FileSystemProvider

  • Set AccessKey and AccessSecret properties

Code samples

using (OpenFileDialog ofd = new OpenFileDialog()) 
{ 
   ofd.Title = "Select a file"; 
   ofd.Filter = "Text Files(.txt)|.txt|All Files (.)|."; 
   ofd.FilterIndex = 0;

   ofd.Roots.Add(new Wisej.Ext.FileSystem.S3FileSystemProvider("yourserver.com", "My Files")
   {
       // use your amazon credentials
       AccessKey = "XXX",
       AccessSecret = "YYY"
    });

    if (ofd.ShowDialog() == DialogResult.OK)
       AlertBox.Show(ofd.FileName);
}

You can define multilple roots for File Dialogs even mixing different providers (local file system, amazon S3 etc.).

Last updated