Usually, the structure for a website with subdomain is this one:
/home/xxxx/public_html/[subdomain]/
So if it's like this, and your script is inupload/
, you could write to../imgs/
. It'd go one directory up to the mainpublic_html
, and then enter theimgs
subdomain folder.
It could be like this too:
/home/xxxx/[subdomain]/
If it's like that, you should write to../../imgs
. That goes one directory up topublic_html
, then once again to the parent ofpublic_html
, and then to its siblingimgs
.
Please note that, depeding on your configuration, the subdomain folder can be anywhere. These 2 examples are the most common ones.