Site icon Hip-Hop Website Design and Development

wp_filesystem put_contents challenge with proprietor/group

I’m utilizing put_contents() perform to place photographs on the server, works superb on localhost, although on server, the consumer group when the file are downloaded to server is “nginx no person” and that’s inflicting the photographs to return 404 error and to not be considered, how can I make the file be downloaded with the default WordPress proprietor/group

    international $wp_filesystem;
    // Initialize the WP filesystem.
    if (empty($wp_filesystem)) {
        require_once (ABSPATH . '/wp-admin/contains/file.php');
        WP_Filesystem();
    }       
$wp_filesystem->put_contents($save_file_to, $file_to_save, 0644)