I'm writing a plugin for an application which has an undocumented API. I'm having to reverse engineer it a bit, but I've run into a part where I need to use javascript (I think).

Basically, the application provides the URL of a file that's being served locally (i.e. http://localhost:80/files/file.pdf).

I need to upload the file. I was initially going to do this in PHP, but then realised there might be an issue with firewalls.

I'm wondering if it's possible to upload the file somewhere in javascript? Or would need to use something like Flex?