Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • On my phone, this file is downloaded normally. The reason is probably related to your browser and its handler Content-Type: application/pdf
    Specify the name and exact version of the browser.
    Try other browsers.
    Try another provider (WiFi, LTE) – the HTTPS-request may be blocked by the firewall on the router for some reason.

    Show your button template.
    This is done using the parameter <a … target="_blank">

    @mrmatthewsg
    The problem (more precisely, the peculiarity of browsers) is related to Content-Type.
    Install the WP Add Mime Types plugin
    And for those extensions that should unconditionally download to a file (not open in a browser), specify the value application/x-force-download.
    For example:

    zip = application/x-force-download
    pdf = application/x-force-download
    doc = application/x-force-download
    7z = application/x-force-download
    rar = application/x-force-download
    mp4 = application/x-force-download
    mkv = application/x-force-download

    Your code doesn’t work because your editor has corrupted the quotes.

    <?php
    /**
     * Shows date and title only.
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    } // Exit if accessed directly
    
    ?>
    <a class="download-link" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
    	printf( esc_html__( 'Version %s', 'download-monitor' ), esc_html( $dlm_download->get_version()->get_version_number() ) );
    } ?>" href="<?php esc_url( $dlm_download->the_download_link() ); ?>" rel="nofollow">
    	<?php echo date("Y-m-d",$dlm_download->get_version()->get_date()->format( 'U' ));
    	echo ' &ndash; ';
    	$dlm_download->the_title(); ?>
    </a>

    The first echo works if the time is 00:00 – so as not to display it.
    This was not the complete code, it is only part of the template.
    You need something like this template:

    <?php
    if ( ! defined( 'ABSPATH' ) ) {	exit; }
    ?>
    <p><a class="aligncenter download-button" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
    <?php 
    echo date("Y-m-d",$dlm_download->get_version()->get_date()->format( 'U' ));
    echo ' &ndash; ';
    printf( esc_html__( 'Download &ldquo;%s&rdquo;', 'download-monitor' ), $dlm_download->get_version()->get_filename() ); 
    ?>
    </a></p>

    if (date(“Hi”,$dlm_download->get_version()->get_date()->format( ‘U’ )) == ‘0000’)
    {
    echo date(“Y-m-d”,$dlm_download->get_version()->get_date()->format( ‘U’ ));
    }
    else
    {
    echo date(“Y-m-d H:i”,$dlm_download->get_version()->get_date()->format( ‘U’ ));
    }

    Thread Starter f2065

    (@f2065)

    I downloaded current version 4.5.92, the problem is solved, the files are downloaded without damage, the download does not freeze. Thanks.

    Thread Starter f2065

    (@f2065)

    plugin uses PHP to serve a download. This will not work when the file is split.

    But why does editing the plugin solve this problem?
    After replacing the lines with
    $new_length=($range_end-$range)+1 and $this->readfile_chunked($file_path,false,$range) – multithreaded downloading starts working correctly.
    In this solution, there is some other problem?
    Or why don’t you do the same?

Viewing 8 replies - 1 through 8 (of 8 total)