Upload local file to remote webserver using Electron [SOLVED]


#1

I’m writing an application, that will be kinda form filling helper. I can prepopulate any input with executeJavascript, but I can’t do same with file elements. Phantomjs has special API for that ( http://phantomjs.org/api/webpage/method/upload-file.html ). Is there anything like that in Electron?


#2

It looks like this module might suit your needs.


#3

That’s not what I aim for. I don’t want to replicate upload query, I want to actually launch website and fill in everything, triggering all JS events remote website has, and potentially allowing user to see how it was filled and adjust.


#4

That sounds doable with just a POST request.


#5

Your suggestion would be my first instinct as well but I think what he’s looking for is something more akin to how 1Password and other such apps auto fill in forms and such on the web. He’s wanting to show the site, script the population of the fields, and let the user see it in case they want to make adjustments, and if not, post it. At least, thats my interpretation of what he’s asking for.


#6

Exactly. Sometimes user will review before submitting, sometimes not, but he needs to be able to.
That is perfectly doable in phantomjs, but I don’t want to integrate it just for that


#7

Found an answer here: https://github.com/electron/electron/issues/749
See last post