【发布时间】:2022-01-20 17:09:13
【问题描述】:
我已经尝试验证画布/屏幕截图是否有效,并且它说有效。我想问题是它没有上传到目录。
我也已经尝试在主机的 Cpanel 中启用 fileUpload 选项。
我也尝试过更改目录,但它仍然不起作用,但它在我的本地主机中运行良好。
if($_POST['image'] != null){
$image = $_POST['image'];
$picpath = $_POST['picpath'];
$image_parts = explode(";base64,", $image);
$image_base64 = base64_decode($image_parts[1]);
$fileLocation = "./public_html/SBAdmin2/includes/customuploads/".$picpath;
file_put_contents($fileLocation, $image_base64);
}
【问题讨论】:
标签: php hosting web-hosting html2canvas file-put-contents