|
Rank: Member Groups: Member
Joined: 9/29/2019 Posts: 13
|
Hi,
Just bought the EO webbrowser for a project. Would like to find out whether it is possible to set the default directory for file upload dialog whenever it pop-up. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
You can handle the WebView's BeforeDownload event, then in your event handler you can set e.FilePath to set the default save file path.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/29/2019 Posts: 13
|
Hi,
I tried but it didn't work. I believe that is for download. I am looking at upload file dialog, which will be triggered by sample codes below:
DOCTYPE html> <html> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> </body>
Please let me know if it is possible to set the default upload directory when this dialog pops up. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Ah. My mistake ---- I though you were asking file download.
For file upload there is no direct way to customize the folder. However you can replace the whole dialog with your own dialog by handling the WebView's FileDialog event. Inside the event you can use .NET's build in OpenFileDialog class to display a dialog. You can then use properties on that class to customize which folder you want to browse.
|
|
Rank: Member Groups: Member
Joined: 9/29/2019 Posts: 13
|
Hi,
Got it working. Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Great!
|
|