Jump to content

quickly moving files across domains with php


semtex

Recommended Posts

I need to move temporary uploaded files (mostly images through a html form) from one domain on a webserver to another domain on the same webserver. What would be the best way to do this?

I mean, I could use php's FTP functions, but I guess that would be an overkill?

I can't use the full path to the domain, as this is not accepted by my hosting company.
Just manually copy and paste them over, it would be the easiest way I think.  Or I guess youcould copy the file with php functions, and then place them in another folder, somewhere else just like you would do when someone uploads them, then unlink the file that you had.
I can't manually copy and paste them, as they're part of a cms I wrote. The user can upload images through the cms. However, i'd like the images to be stored on the domain of his website, and not on the domain where the cms resides.

I can't do it manually cause it needs to happen rightaway. Immediately after the user has uploaded his/her image(s).
If you don't have direct access to the directory structure of the other domain, I would recommend you use the built in FTP functions. Also, if the other domain moves to a different web server, then your code wouldn't have to change.

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.