Good Evening,
I have a sync from facebook using the API to download the images from an album and save to uploads in the root directory.
This was working perfectly but since going production i have had to swap to a subdomain due to shared hosting.
The line for the path i was using is as follows, how would i convert this to save from subdomain.
$path = Yii::getAlias('../uploads/fb/thumb/' . $id . '.jpg');
__DIR__.'/../uploads/fb/thumb/'
$path = Yii::getAlias(__DIR__.'/../uploads/fb/thumb/' . $id . '.jpg');
If a folder is fixed and specified, you can get help from the Url::to()
or Url::toRoute
:
\yii\helpers\Url::to('path/yourFolder/');
Or use Predefined Aliases here
like: @webroot/..
>= 2.0.3
echo \yii\helpers\Url::current(); // help?id=1 for example.com/help?id=1