move_uploaded_file permission denied problem

Dear All,

I got this problem while uploading:

move_uploaded_file(C:\xampp\htdocs\weblink\application\protected\modules\portfolios\assets) function.move-uploaded-file: failed to open stream: Permission denied

I have searched, and googled, but can’t find the problem. And then I found this website: http://yii.dbhelp.ru/form-file-upload/post, and one of the comments there indicate that someone has the same problem like I am having now, but I don’t understand any of the language there.

Please help me correct this problem, thanks.

Could you post your upload code?

Windows may deny your file operations if the source or the target is read-only, or you are not the owner of both.

Hi, thanks for the reply.

Oh, I did change the file permission to be not read only. One thing I do not understand is that, I have unchecked the read only folder permission on windows, and when I right click again on the folder and choose to show the permission window, the Read Only is always being checked. I am on my personal computer by the way, so I have my own administrative access.

So, how do you let the read only stay unchecked ? (maybe that would be a proper question for this problem)…

Thanks.

It might help to know which version you’re using. This is not related to Yii, though, you may want to try a Windows forum instead.

Hello…

I cannot save uploaded file because of path not found issue.

Is there any special default path to save uploaded file?

like: Yii::app()->somePath

Thanks

Kris

Hi Kris,

Make sure your temporary folder is writable. You can save your uploaded wherever it fits your requirements. If you showed us a stack trace with full error message, we could help you more.