ftp_get, ftp_fget - save to a different domain in same account

Discussion in 'PHP and MySQL' started by gsaunders, Jul 21, 2006.

  1. gsaunders

    gsaunders Perch

    Hey guys,

    When using either the ftp_get or ftp_fget is there a way to save the file to a different subdomain in my account.

    For example the php script is running in a domain called sub1.domain.com. I use ftp_get or ftp_fget to grab a file from a remote ftp server and want to store the file in my sub2.domain.com which is a part of the same account.

    How can I do this?

    Thanks... new at this part of php.
  2. skypanther

    skypanther Exalted Code Master!

    Never done it, but looking at the help text on these two functions it seems that it would work. Just provide the explicit (full) path to the subdomain or provide a resource handle to a file in the other subdomain.

    If that doesn't work, you could store the file in a temp folder within your current domain and then use the file manipulation functions to move. Of course, that temporarily doubles your disk usage per file.

    Tim

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services