我正在创建一个Chrome扩展程序,该扩展程序可以使用Podio API PHP创建指向Podio的任务。另外,它可以附加文件。这在localhost上运行良好。但是,当我将php文件上传到实时服务器上时,我在PodioFile::upload
中收到错误消息,并显示'PodioServerError'
。
$longStringPathAndName = "url_of_image|filename_of_image,url_of_image2|filename_of_image2"
$longArrayPathAndName = explode(",", $longStringPathAndName);
/*Declare the filearray holder */
$strAttachment = array();
/*Loop for every file item */
$xx = 1;
for ($xx = 0; $xx < count($longArrayPathAndName); $xx++) {
/*split each file item according to pipe (|), to separate the filepath and filename */
$arrFile = explode("|", $longArrayPathAndName[$xx]);
/*Temporarily upload the file, place it in $file so we can get the file_id */
$file = PodioFile::upload($arrFile[0], $arrFile[1]);
/*Append the new file_id to the filearray holder */
array_push($strAttachment, $file->file_id);
}
谢谢大家! ^ _ ^
[EDIT] 2019年11月8日
我将php文件上传到了免费的虚拟主机(000webhost)上,并且可以正常工作!我的问题是,我不想使用此免费主机,因为我已经在Netvirtue中购买了主机包。 Netvirtue是否设置了任何限制,使得PodioFileUpload
无法使用?
要对其进行总结: