Jump to content

copy/move files from domain to subdomain


cnapsys

Recommended Posts

hey all,

I've been struggling with this for the last few days and can't figure it out...

I'm trying to build a fairly complex uploading system.

 

the thing i'm getting stuck with is trying to copy/move the uploaded files from the domain name to a subdomain

 

Ex:

$path1 = "/var/www/vhosts/domain.com/httpdocs/new/test/test.jpg";

$path2 = "/var/www/vhosts/domain.com/subdomains/img/httpdocs/test/test.jpg";

 

Dedicated server running RHEL with Plesk

 

The problem seems to be an open_basedir restriction.

 

My question is... are there any work-arounds open_basedir and if not what are the implications of disabling it???

 

Any help is greatly appreciated.

Thank you for your time

 

c

Link to comment
https://forums.phpfreaks.com/topic/246205-copymove-files-from-domain-to-subdomain/
Share on other sites

    Store a temporary file in the /tmp directory from the source site and trigger a process in the target site to fetch the file. You can use the curl functions to do so.

 

    Store files in a common database. The storage does not need to be permanent if you think that will affect your site performance. Target site just needs to check whether it has pending incoming files.

 

    Add files to a queue (perhaps a special directory inside httpdocs) and write a command line script to push them to the target site. Run this command with cron (lets say, once every minutes).

 

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.