Welcome Guest Search | Active Topics | Sign In | Register

Set default directory for File Upload dialog Options
Clarence
Posted: Sunday, September 29, 2019 8:21:57 PM
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.
eo_support
Posted: Monday, September 30, 2019 9:30:11 AM
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!
Clarence
Posted: Tuesday, October 1, 2019 3:38:33 AM
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.
eo_support
Posted: Tuesday, October 1, 2019 9:23:36 AM
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.
Clarence
Posted: Tuesday, October 1, 2019 10:49:45 PM
Rank: Member
Groups: Member

Joined: 9/29/2019
Posts: 13
Hi,

Got it working. Thanks!
eo_support
Posted: Wednesday, October 2, 2019 9:53:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Great!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.