Cross domain ulpoading

Ask about a PHP problem here.
Post Reply
sevvlor
Posts: 22
Joined: Fri May 06, 2011 10:46 pm

Cross domain ulpoading

Post by sevvlor »

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.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Cross domain ulpoading

Post by jacek »

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.
Image
sevvlor
Posts: 22
Joined: Fri May 06, 2011 10:46 pm

Re: Cross domain ulpoading

Post by sevvlor »

I got it working just the way I wanted it to!
Thanks for the help, I forgot all about FTP
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Cross domain ulpoading

Post by jacek »

No problem :D
Image
Post Reply