0

I have a site that generates some image files. Instead of saving to within the site's DocumentRoot like \home\mysite\public_html\photos, I want to save to another user's directory like \home\anothersite\public_html\photos. The reason for doing this is to facilitate a move of all photos to its own dedicated server just for serving images.

Is there a way for PHP to save a file to another user's directory? I am thinking of using rename() and disabling open_basedir. Or should I use ftp_fput()?


Update

When I try this (which involves mkdir() to create new directories), I get the error:

mkdir() [function.mkdir]: Permission denied

Did I miss out on some permission settings?

Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
  • As long as you have write permissions, you can save it exactly the same way as you are doing now / in the current directory. PHP does not care about the document root of the web-server. – jeroen Sep 16 '12 at 00:35

1 Answers1

1

You can save it exactly the same way as you are doing now / in the current directory. PHP does not care about the document root of the web-server

Answer by Jeron.

Nyxynyx
  • 61,411
  • 155
  • 482
  • 830