开发者

check/upload images to domain folder from subdomain

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.

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!

THANK YOU EVERYONE! I SOLVED IT MY SELF. ADDED ../../www IN FRONT OF images. NOTICED A SHORTCUT IN HOME DI开发者_运维问答RECTORY AND IT WORKED.


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');


If you are using IIS you could define a "virtual" folder in one website that points to a physical folder somewhere on the server.

So you could define a virtual folder called "images" and map it to a physical folder that is the same folder as the images folder of another site.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜