File Browser from any Drive on computer

0
0

Hi Team,

I need the user to be able to browse for a file from any drive on the computer. The application should initially point to “My Document” folder but the user should be able to navigate to “My Computer” or “This PC” and locate the file on the other drives on the computer without me having to first list those drives in code.

I followed the support ticket in the link below but have not been successful, any help will be greatly appreciated.

https://wisej.com/support/question/openfiledialog-1?sort=oldest

Below is the code:

 

Dim ofd As New OpenFileDialog

ofd.Roots.Add(New FileSystemProvider(“C:\\”, “Images”))
ofd.ShowDialog()

Dim filPathx As String = System.IO.Path.GetDirectoryName(ofd.FileName)
Dim filNamex As String = System.IO.Path.GetFileName(ofd.FileName)
Dim filExtensionx As String = System.IO.Path.GetExtension(ofd.FileName)

Dim sourceFilePathx As String = filPathx & “\” & filNamex

pbxPicx.Image = Image.FromFile(ofd.FileName)

 

*I will need the file name, path and extension of the file.

pbxPicx is a picture box that should display the image.

 

 

 

 

  • You must to post comments
0
0

Hi Nicholas
Sorry for the late answer
Sadly, browsers don’t let you browser a user’s computer and
the OpenFileDialog maps drive units on server, not user pc.

But for do your goal, there are three options

1) upload files using the Upload control or drag and drop a file (see docs online) and process it on server
2) user the https://www.nuget.org/packages/Wisej-3-ClientFileSystem extension which uses the browser’s file access api
The client file access api is documented on the mozilla web site.
3) contact sales for custom support, if our goal is more complex and is outside of our free support scope.

HTH
Paul

  • You must to post comments
0
0

Hi Nicolas

In this support post you can find details about the same question

Also here you can see the documentation about it

Regards

  • Nicholas
    Hi Paul, the example in the “support post” is what i followed in executing my solution but it doesn’t give the required output if you check from the attached images above. I want to be able to set default location to say “My Document” but the user should be able to browse for a file on any disk on the computer without me having to list all the drives on the computer at design time or through code. How do i achieve that as i didn’t find anything of that sort in the documentation and the support post. Thanks
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.