Q:

try to upload image on a web page using this code, it keep giving error

    <?php
if (isset($_FILES['file'])) {
    $file_name = $_FILES['file']['name'];
    $file_tmp = $_FILES['file']['tmp_name'];
    $upload_folder = "images/";

    $move_file = move_uploaded_file($file_tmp, "$upload_folder/$file_name");

    if ($move_file) {
        echo "The file has been uploaded.";
    } else {
        echo "Sorry, there was an error uploading your file.";
    }
}
?>
<!DOCTYPE html>
<html>
<body>

    <form method="post" enctype="multipart/form-data">
        Select image to upload:
        <input type="file" name="file" id="file">
        <input type="submit" value="Upload Image" name="submit">
    </form>

</body>
</html>

here is the euro
Warning: move_uploaded_file(images//489452.jpg): failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/ncs_project/test.php on line 7
Warning: move_uploaded_file(): Unable to move '/Applications/XAMPP/xamppfiles/temp/php5kvoOW' to 'images//489452.jpg' in /Applications/XAMPP/xamppfiles/htdocs/ncs_project/test.php on line 7

A:

Change images folder  permission to read and write 

