重定向文件上传

I'm building a website in PHP where I have split up the project in two parts, the api and the "web application". The api is accessed at http://api.localhost and the other part at http://localhost.

Now on http://localhost I've added a Dropzone form but I want to handle the request at http://api.localhost/upload. Since it's different domains, dropzone doesn't seem to allow it out of the box.

Can I upload the file to http://localhost and somehow redirect the file to http://api.localhost/upload? Or is there something else I can try?