您知道如何使用file_get_contents('php://input')
以下是我的内容
public function upload_image()
{
$str = file_get_contents('php://input');
$filename = md5(time()) . '.jpg'; // I don't want to use this line
$path = public_path() . '/uploads/' . $filename; // I want to use original file name here
file_put_contents($path, $str);
echo $filename;
}
答案 0 :(得分:1)