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 enabledWhen 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 disabledWhen 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.
ConclusionThis 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.