简体   繁体   中英

Access images uploaded to one CakePHP app from another CakePHP app

I have a CakePHP project whare i have given the user the ability to upload profile images. The images are uploaded to the webroot/uploads/users folder. I need to have another CakePHP project that acts as a admin panel for the first app. I need to display the images uploaded to the first project in the admin panel.

I can have the admin panel project either inside the first CakePHP project or as a separate project. What i'm telling is something like this. Either

www.example.com/admin/ <= Inside the first project
www.admin.example.com/ <= In a sub domain 

It doesn't matter which way it is. But my problem is that i have no idea of how to access the images in webroot/uploads/users/ folder from the admin panel project.. How can i do this. Thanks in advance.

I had this very problem when creating a front facing site with a cms admin panel. I got around it by setting up symbolic links on the server to the specific image folders:

sudo ln -s /var/www/example.com/subdomains/admin/httpdocs/app/webroot/img/profile_images /var/www/example.com/httpdocs/app/webroot/img/profile_images

Any images uploaded on the admin site are then immediately available on the other site. It isn't a CakePHP solution but it does the job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM