OpenFileDialog

0
0

Hello, I’m using openfiledialog but at the time of executing in the folder section does not load anything, I do not know if I lack any property or a line of code could help me please thank you.

  • You must to post comments
0
0

It’s the same as FileSystemProvider with the additional S3 credential:

using (var openFile = new OpenFileDialog())
{
    openFile.Roots.Add(new FileSystemProvider(“C:\\UserFiles\\User1”, “My Files”));
    openFile.Roots.Add(new S3FileSystemProvider(“{BUCKET NAME}/UserFiles/User1”, “My S3 Files”) {
         AccessKey = "{YOUR S3 ACCESS KEY}",
         AccessSecret = "{YOUR S3 ACCESS SECRET}"
    });
    openFile.ShowDialog();

}

 

  • You must to post comments
0
0

Hi Luca

Can you send a small example for Amazon S3 extension ?

Thanks

 

 

  • You must to post comments
0
0

You need to add a file system to the Roots property. Otherwise the file dialog would show your server’s content. You can have multiple roots, as simple as “C:\\” to anything you want to show to the user. The file system can be local, or can be a cloud drive like Amazon S3, OneDrive, GoogleDrive, or even a database. You can implement a custom file system by implementing the IFileSystemProvider interface.

We provide 2 so far, the default one is the file system and Amazon S3 (with full source code) here:  https://github.com/iceteagroup/wisej-extensions/tree/master/Wisej.FileSystem.AmazonS3.

Simple sample:

using (var openFile = new OpenFileDialog())

{

openFile.Roots.Add(new FileSystemProvider(“C:\\UserFiles\\User1”, “My Files”));

openFile.ShowDialog();

}

Notice that in this way you can show different directories to different users and still use the name “My Files” for all. The File name will “My Files\\…”. You will have to map it to the root using openFile.FileSystem which returns the file system that corresponds to the file picked by the user.

Wisej is operating in a shared environment and it needs to be able to separate resources by user.

 

 

 

 

  • Guadalupe ochoa
    Hi Luca, Thanks for your help and I solved it.
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.