Welcome Guest Search | Active Topics | Sign In | Register

HTML5 input file element does not work correctly (for single and for multiple) Options
PS
Posted: Thursday, June 27, 2019 11:07:23 AM
Rank: Advanced Member
Groups: Member

Joined: 10/24/2018
Posts: 97
Hi, we are having the following issue with the webbrowser.
Our customers are reporting that they cannot upload files to us using the webbrowser control.

First the sample* code, then additional explanation below:

Quote:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

using EO.WebBrowser;
using EO.WinForm;

namespace EOTestHtmlInputFile
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(CreateNewForm());
}

private static Form CreateNewForm()
{
var form = new Form
{
Size = new System.Drawing.Size(1280, 1024)
};

var webView = new WebView();
webView.LoadHtml(
@"<!doctype HTML>
<html>
<head>
<script type='text/javascript'>
window.onload = function() {
document.getElementById('fileupload').addEventListener('change', function(ev) {
alert('uploaded!');
});
}
</script>
</head>
<body>
<br />
<form>
<input id='fileupload' type='file' name='fileupload' multiple='multiple' />
</form>
</body>
</html>");

var webControl = new WebControl
{
Dock = DockStyle.Fill,
WebView = webView
};

form.Controls.Add(webControl);

return form;
}
}
}


* This sample code is only used for the reproducible example, in reality we have this file upload on a website that our customers use.

Situation 1: Multiple enabled
When multiple files is enabled, the change event is not fired when an user only selects a single file. We expect the change event to be fired regardless of whether one or multiple files are selected.

Situation 2: Multiple disabled
When multiple files is disabled the user can only upload a single file. The functionality itself seems to be working, however pressing the "Choose File" button does not always work, more specifically it always seems to fail the first time an user clicks the button.

Conclusion
This is a serious issue because we cannot provide a reliable workaround. Multiple files does not work for a single file only, and non-multiple does not always work. We hope a solution will be available very soon.
eo_support
Posted: Monday, July 1, 2019 11:47:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

This is due to a bug in our default FileDialog implementation. This bug will be fixed in our next build. In the mean time you can handle FileDialog with your own code and that should bypass the default implementation thus avoiding both issues. We will reply again when the new build is available.

Thanks!
eo_support
Posted: Friday, July 5, 2019 2:46:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

This is just to let you know that we have posted a new build that should resolve this issue. You can download the new build from our download page. Please take a look and let us know how it goes.

Thanks!
PS
Posted: Monday, July 8, 2019 4:29:54 AM
Rank: Advanced Member
Groups: Member

Joined: 10/24/2018
Posts: 97
Hi, this new build does indeed fix the issue. Thank you!
eo_support
Posted: Monday, July 8, 2019 8:35:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Great. Thanks for confirming.


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.