How To Make Pubilc Folder In Protected


I am trying to save my media file(.mp3) in C:\xampp\htdocs\beatwar\protected\uploaded\dhole.mp3.

But this file dhole.mp3 is not accessible direct.So what i did i created my uploaded folder out side protected

which is like :-beatwar/uploaded.

Now i can access this but this tym i am facing issue when i am saving file in this.

I have tried both and got failed.

Here is my code what i am trying:-

$dir = Yii::getPathOfAlias(‘application’);


$dir = Yii::app()->request->baseUrl."/uploads";

Please can anybody help me both ways

1)How to access any folder directly which is in protected.

2)the way how to store file in a folder which is in webroot folder.

In second case i am facing this issue while trying request->baseUrl.

move_uploaded_file(/beatwar/uploads/music.mp3) [<a href=‘function.move-uploaded-file’>function.move-uploaded-file</a>]: failed to open stream: No such file or directory