title: How to upload file using Geckofx 60 in VB.NET without opening dialog?
body: <p>I'm using Geckofx 60 to fill a web form. I have to attach an image file also. I can select/click <code>Chose file</code> and Select a file manually. Is there any way to select a local file without opening dialog?</p>
  <pre><code>    Dim el As GeckoHtmlElement = GeckoWebBrowser1.DomDocument.GetElementsByTagName(&quot;input&quot;).FirstOrDefault(Function(elz) elz.GetAttribute(&quot;type&quot;) = &quot;file&quot;)
      Dim fileNames = New IntPtr(0) {}
      Dim domInput = Xpcom.QueryInterface(Of nsIDOMHTMLInputElement)(el.DOMHtmlElement)
      domInput.MozSetFileNameArray(fileNames, CUInt(fileNames.Length)) 'Getting Error
      Marshal.ReleaseComObject(domInput)
      Dim ev As DomEventArgs = GeckoWebBrowser1.Document.CreateEvent(&quot;HTMLEvents&quot;)
      Dim webEvent = New [Event](GeckoWebBrowser1.Window.DomWindow, TryCast(ev.DomEvent, nsISupports))
      webEvent.InitEvent(&quot;change&quot;, True, True)
      el.GetEventTarget().DispatchEvent(ev)
      CustomMarshalers.WStringMarshaler().CleanUpNativeData(fileNames)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Sawc3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sawc3.png" alt="enter image description here" /></a></p>
  <p>I have Got the Error above after checking <a href="https://stackoverflow.com/questions/56158777/how-to-choose-and-upload-a-local-file-to-a-website-using-geckofx-in-c">How to choose and upload a local file to a website using Geckofx in C#?</a></p>