php上传报未定义偏移量,php - 使用chrome下载文件时出现PHP错误(未定义偏移量:1) - 堆栈内存溢出...

我有一个PHP脚本来管理下载(VIP用户只能下载),该脚本可与常见的下载管理器和浏览器(如firefox,IE,IDM和Edge)一起使用,但是当我想使用chrome下载时出现此错误文件:

未定义的偏移量:第103行的/home/username/public_html/index.php中的1

第103行:list($ range,$ extra_ranges)= explode(',',$ range_orig,2);

//check if http_range is sent by browser (or download manager)

if($is_resume && isset($_SERVER['HTTP_RANGE']))

{

list($size_unit, $range_orig) = explode('=', $_SERVER['HTTP_RANGE'], 2);

if ($size_unit == 'bytes')

{

//multiple ranges could be specified at the same time, but for simplicity only serve the first range

//http://tools.ietf.org/id/draft-ietf-http-range-retrieval-00.txt

list($range, $extra_ranges) = explode(',', $range_orig, 2);

}

else

{

$range = '';

}

}

我已经尝试了一些在stackoverflow主题中找到的代码,但是没有用!

list($range, $extra_ranges) = explode(',', $range_orig);

list($range, $extra_ranges) = array_pad(explode(',', $range_orig, 2), -2, null);

list($range, $extra_ranges) = explode(',', $range_orig. ',');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值