hey I have a question.
I'd like to let my users cross upload an avatar to my static domain rather than the domain where the website is hosted on.
I know it's possible but I don't know how.
Cross domain ulpoading
Re: Cross domain ulpoading
I'm not sure how this is done normally.
Generally you have yourdomain.com and static.yourdomain.com or something similar to that where the static domain is actually hosted on the same machine, if that is how you have it set up you can just move the file as normal using move_uploaded_file()
If you have the static domain on a different server you will have to transfer the uploaded file to it, the first thing that comes to mind there would be using FTP since php can do that pretty well with the FTP extension. You could also do it using a second script on the static server, but that requires it to be not just static content Plus FTP would be more future proof and let you keep all your code in one place.
Generally you have yourdomain.com and static.yourdomain.com or something similar to that where the static domain is actually hosted on the same machine, if that is how you have it set up you can just move the file as normal using move_uploaded_file()
If you have the static domain on a different server you will have to transfer the uploaded file to it, the first thing that comes to mind there would be using FTP since php can do that pretty well with the FTP extension. You could also do it using a second script on the static server, but that requires it to be not just static content Plus FTP would be more future proof and let you keep all your code in one place.
Re: Cross domain ulpoading
I got it working just the way I wanted it to!
Thanks for the help, I forgot all about FTP
Thanks for the help, I forgot all about FTP