Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress文件下载仅在Firefox中没有扩展名_Php_Html_Wordpress_Firefox - Fatal编程技术网

Php Wordpress文件下载仅在Firefox中没有扩展名

Php Wordpress文件下载仅在Firefox中没有扩展名,php,html,wordpress,firefox,Php,Html,Wordpress,Firefox,Wordpress中下载按钮的代码在Chrome中工作,但在Firefox中,图像下载时没有扩展名 <div class="download-button"> Download: <a target="_self" href=" <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full', false ); ech

Wordpress中下载按钮的代码在Chrome中工作,但在Firefox中,图像下载时没有扩展名

<div class="download-button">
Download: <a target="_self" 
    href=" <?php 
        $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full', false );
        echo $src[0]; // the url of featured image?> " 
        download="<?php echo get_the_title(); ?>" 
        width="<?php echo $src[1]; ?>" 
        height="<?php echo $src[2]; ?>" 
        title="<?php echo get_the_title(); ?>" >
        <?php echo $src[1]; ?>x<?php echo $src[2]; ?>
    </a>
 </div>

下载:
如果使用“将目标另存为”,它确实有一个扩展名

<div class="download-button">
Download: <a target="_self" 
    href=" <?php 
        $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full', false );
        echo $src[0]; // the url of featured image?> " 
        download="<?php echo get_the_title(); ?>" 
        width="<?php echo $src[1]; ?>" 
        height="<?php echo $src[2]; ?>" 
        title="<?php echo get_the_title(); ?>" >
        <?php echo $src[1]; ?>x<?php echo $src[2]; ?>
    </a>
 </div>

为什么下载时会保存扩展名?

上面代码的实际HTML输出是什么?标题中是否有扩展名,如果没有,则是firefox正确工作。上面代码的实际HTML输出是什么?标题中是否有扩展名,如果没有,则是firefox正确工作