emen emen - 11 months ago 60
PHP Question

Change default permission in cPanel for images

I have a new gallery site and in admin page I upload image for my posts. images upload in 'img' folder in cPanel around my files but my problem is I can't see images :

You don't have permission to access
/pages/on_login_pages/uploads/269809192.jpg on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an
ErrorDocument to handle the request.


I know about permissions that images must 0644 but I want to set permissions when I posts images to site every time:( ...
Is there any way?

This is my source code for upload:

$path = basename($_FILES['img']['name']);
$name = $_FILES['img']['tmp_name'];
$rand_name = rand() . '.jpg';
rename($name, 'uploads/' . $rand_name);

Answer Source

it is about your random name codes check your php upload file and change random config code...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download