Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m a little late to the party, but here’s how I solved this problem.

    function buddydriveFileDownload($buddydrive_file) {
        status_header( 200 );
        header( 'Cache-Control: cache, must-revalidate' );
        header( 'Pragma: public' );
        header( 'Content-Description: File Transfer' );
        header( 'Content-Length: ' . filesize( $buddydrive_file->path ) );
        header( 'Content-Disposition: inline; filename='.$buddydrive_file->file );
        header( 'Content-Type: ' .$buddydrive_file->mime_type );
    
        while ( ob_get_level() > 0 ) {
            ob_end_flush();
        }
    
        readfile( $buddydrive_file->path );
        die();
    }
    
    add_action('buddydrive_file_downloaded', 'buddydriveFileDownload');
    • This reply was modified 7 years, 3 months ago by rfirevtre.

    Where do you put this?

    Greg

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Open shared files in the browser’ is closed to new replies.