AJAX File Upload Cross Domain

I am trying to upload files via AJAX across different domains to a remote image server. I have a little PHP script on the remote server that accepts the files and does a little Imagick magic on it, then stores it in the proper folder. I can upload remotely fine using traditional forms and I can upload locally fine using AJAX. But I can’t upload remotely using AJAX. Googling around it seems that there are a lot of issues doing this, but I couldn’t find any solutions.

Has anyone ever done this before and found a solution?

My only other alternative is to accept it locally then stream it using ScalaStream, but that is probably going to be overly complicated and I would like to keep all image processing separate from the main app if possible. I just want the simplest easiest to implement solution at this point.

I’m using jQuery 2.1.1 the remote server is nginx and php5-fpm

I misunderstood the purpose of ScalaStream, but I was able to implement something using Scalaj HTTP which was pretty easy.

But I still would like to forgo using the main app if possible, this is just more overhead that really shouldn’t be needed.