I wanted clipboard access for a web app that I built for my own use on my local server, and I came up with this:
First a batch file that reads from another file:
clip < %1
and then in my PHP file:
exec("mybatch.cmd $file_with_text_to_be_copied");
no return variable needed, just straight execute…
No error in any log, but it just doesn’t work.
I’m not surprised it doesn’t work, given the security around clipboards, but I can’t figure out why – how does chrome or Apache or whoever even know whats I’m doing?
I even tried something I read online about changing the Apache service account to being run by another account user (I think it was the system account – can’t remember – but it was whatever I read online)
but no change…
Windows machine by the way – just in case that got missed.
The clipboard is a property of the session, so the clipboard you use with ctrl-c and friends on your desktop session is not the same, as the clipboard your webserver sees.
So without any helper app (running in your session) this is not possible.
BTW: It is good, this is not possible. Think over that, until you believe it.