我的代码在这里:
if(Input::hasFile('image'))
{
if (File::exists(public_path("user_images/{$users[0]->image}")))
{
// delete image from folder
unlink(public_path("user_images/{$users[0]->image}"));
}
$file = Input::file('image');
$name = time(). '_' . str_random(20). '_' . $file->getClientOriginalName();
$file = $file->move(('user_images'), $name);
$uUpdate = User::updUserProImg($userId,$name);
}
错误:
取消链接(E:\ xampp \ htdocs \ o2schools \ public \ user_images /):权限 拒绝
我该如何解决?
答案 0 :(得分:0)
您可以使用Storage :: delete($ filePath)