in reply to triggering a program in web server


You can launch the upload-to-B program directly from the script which, on A, receives the file uploaded via web. This might however slow the response to the user down, depending on how fast is the connection between A and B.

Another option is to have upload-to-B program run as a daemon, which every now and then (how much often you wish) checks for new uploaded files and sends them to B.

Hope this helps!