I study PHP using books
The content is to make a shopping cart, and I stumbled when I tried to upload the product image.
When I add an image,
Warning: move_uploaded_file (./gazou/aspara_yama.jpg): failed to open stream: Permission denied in/Applications/XAMPP/xamppfiles/htdocs/product/pro_add_check.php on line 48
This error will result in
I checked the copied code many times, but I couldn't see the wrong part.
Sharing and permission to upload image folders were read/writeable
move_uploaded_file($pro_gazou['tmp_name'], './gazou/'.$pro_gazou['name']); print'<img src="./gazou/'.$pro_gazou['name'].'>'; print'<br/>'; print'<input type="hidden" name="price" value="'.$pro_price.'">;;
I copied the code like this, but the image is not displayed and an error appears.php
As the error message indicates, the image upload destination directory does not have write permission.On Linux, you can run the following commands:
chmod777 [Path to Image Destination Directory]
For example, to save an image to
© 2023 OneMinuteCode. All rights reserved.