php文件上传失败 SyntaxError: Unexpected token ‘<‘, “<!doctype “… is not valid JSON
•
数据库
完整报错
Failed to load resource: the server responded with a status of 404 (Not Found) uploadExcelFile.js:29 上传文件失败: SyntaxError: Unexpected token ‘<', "<!doctype "… is not valid JSON
代码
// 移动上传的文件到目标目录
$targetPath = '/resuto' . $file['name'];
move_uploaded_file($file['tmp_name'], $targetPath);
// 执行数据处理操作,生成结果文件
// ...
// 返回处理结果文件信息
$response = [
'fileName' => 'processed_results.csv',
'fileUrl' => '/resuto/lts/processed_results.csv'
];
解决方案
检查保存文件目录”resuto“的权限,将755权限改为777即可解决

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/8b29cd48fc.html
