2

I would like to let my PHP Controller (Laravel 5.5) send a command to a C# program (that i wrote myself) to execute a function on the click of a button on my page.

To clairify:

I have a webApp that allows users to create a config archive for a device, which they can then import into the device. Though since the webApp is on a public server and the device is connected on local LAN, I cannot upload this archive to its local FTP server.

So i gave the users the option to simply download this .zip archive from my public server (Linux - CentOS btw) and i wrote a windows program (in C#) that allows the user to browse (on their local windows pc) for the package and upload it via FTP to the device's root directory.

I made the download page for the archive public for a while so you can see what i mean:

Download page

So to summarize what i'm trying to accomplish: A user visits a webpage on my public server (see link), clicks a button there and the PHP sends a command to my C# application on the user's windows PC which then executes a function

2
  • Instead of (implied) "searched a lot" and "will reply to comments" text in the post it would be much more useful if you'd clarify where you want to run PHP code and where you want to run exe (same server, different servers, user's machine for one or both, some other options).... Commented Nov 7, 2017 at 16:46
  • edited the post, so it's more clear, PHP on public server @ remotefactories.com & C# on local windows machine Commented Nov 7, 2017 at 16:52

1 Answer 1

3

You could use a Custom URI Scheme/Pluggable Protocol Handler.

This would allow you to make a link in the format:

<a href="yourHandlerName:http://url.to/download.zip" ..> Install to Local Device </a>

Clicking the link would run your application (after user approval) passing the URL as a command line - you would parse this out, download the file and perform your local FTP operation.

Sign up to request clarification or add additional context in comments.

1 Comment

This seems like it could be the answer to my problems, I'll try to see if I can build a solution that works and I'll get back to you...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.