pCloud 您的下载已过期。再次尝试上一步
pCloud Your download expired. Try previous step again
我使用 pcloud 基础架构供用户在我们的网站上上传文件。
但是我在使用 api 时遇到了问题。在下载功能里file.php
$ fileLink = $ this-> getLink ($ fileId);
我们 using.but 过了一会儿对用户说“您的下载已过期。请重试上一步。”报错。请问有什么办法可以解决吗?我要无限下载time.Thank求助
API Github: http://github.com/pCloud/pcloud-sdk-php/
我找到了答案。
您必须在下载功能上添加此代码,在 return 行之前;
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);
我使用 pcloud 基础架构供用户在我们的网站上上传文件。
但是我在使用 api 时遇到了问题。在下载功能里file.php
$ fileLink = $ this-> getLink ($ fileId);
我们 using.but 过了一会儿对用户说“您的下载已过期。请重试上一步。”报错。请问有什么办法可以解决吗?我要无限下载time.Thank求助
API Github: http://github.com/pCloud/pcloud-sdk-php/
我找到了答案。
您必须在下载功能上添加此代码,在 return 行之前;
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);