What permissions should be checked for the upload folder when facing upload issues on a web server?

When facing upload issues on a web server, one common solution is to check the permissions of the upload folder. The folder should typically have write permissions so that files can be uploaded successfully. If the permissions are not set correctly, the server may not allow files to be uploaded.

// Check and set permissions for the upload folder
$upload_folder = 'path_to_upload_folder';

// Check if the upload folder has the correct permissions
if (!is_writable($upload_folder)) {
    chmod($upload_folder, 0777);
}