从子域检查/上传图像到域文件夹 [英] check/upload images to domain folder from subdomain
问题描述
我有域名www.mysite.com和子域名api1.mysite.com。那里(在域中)有几个文件夹和文件夹图像。还有一个名为api1的文件夹是子域的文件夹。我不能弄清楚,是如何从子域中找到一个多米诺骨牌的文件夹图像,并在那里上传文件或检查它们是否存在。我正在使用php。例如
I have domain www.mysite.com and subdomain api1.mysite.com. There (in domain) are several folders and folder "images". There also is a folder called api1 which is subdomain's folder. What I can't figure out, is how to locate from subdomain a domian's folder "images" and upload files there or check if they exist. I'm using php. e.g.
此行位于子域文件夹中的一个文件中,images文件夹是一个级别的 - 在域文件夹中。
this line is located in one of the files in subdomain folder and "images" folder is one level up - in domain folder.
$dir_img_small = file_exists('images/users/small/i_'.$profile_id.'.jpg');
我尝试使用 ../
图像,但它没有工作。请帮助!
I tryed to use ../
before images but it didn't work. Please help!
谢谢你们!我解决了我的自我ADDED ../../www IN FRONT OF图像。请注意家庭目录中的一个更短的工作和工作。
THANK YOU EVERYONE! I SOLVED IT MY SELF. ADDED ../../www IN FRONT OF images. NOTICED A SHORTCUT IN HOME DIRECTORY AND IT WORKED.
推荐答案
也许您应该尝试提供目录的完整路径: p>
Perhaps you should try to provide the full path to the directory:
$root_path = "enter root path here/";
$dir_img_small = file_exists($root_path . 'images/users/small/i_'.$profile_id.'.jpg');
这篇关于从子域检查/上传图像到域文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!