我使用pcloud基础设施来让用户在我们的网站上上传文件。
然而,我在使用api时遇到了问题。在file.php的下载功能中
$ fileLink = $ this-> getLink ($ fileId);我们将在一段时间后向用户提示“您的下载已过期,请再次尝试上一步”。给出了一个错误。我想知道有没有办法解决这个问题?我想要无限的下载time.Thank你的帮助
Github接口:http://github.com/pCloud/pcloud-sdk-php/
发布于 2021-02-22 20:30:49
我找到了答案。
必须在download函数中的返回行之前添加此代码;
header('Content-Description: Description');
header('Content-Type: application/x-zip-compressed');
header('Content-Disposition: attachment; filename='.basename($path));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($path));
fclose($file);
fclose($source);
readfile($path);https://stackoverflow.com/questions/66208147
复制相似问题