Jump to content


Photo

quickly moving files across domains with php


  • Please log in to reply
3 replies to this topic

#1 semtex

semtex
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 07 July 2006 - 01:09 PM

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.

#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 07 July 2006 - 01:13 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 semtex

semtex
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 07 July 2006 - 01:16 PM

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).

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 07 July 2006 - 01:29 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users