在Laravel图片中,当我使用Andriod Mobile时无法上传

时间:2019-07-19 07:19:54

标签: php laravel

在Laravel中文件上传在Andriod Mobile上不起作用。但是当我使用  iPhone文件上传有人知道是什么问题吗?我看到很多 关于stackoverflow的问题,但没有人给出答案。

function insertData($table, $fields, $values, $conn){
    $field_val = implode(", '",$fields);
    $values_val = implode(",`",$values);
    $query = "insert into ".$table." (".$field_val.") values(".$values_val.")";
    mysqli_query($conn, $query);
}
//Calling the function//
if(isset($_POST["signup"]))
{
    $FullName = $_POST["FullName"];
    $Email = $_POST["Email"];
    $Password = $_POST["Password"];
    $table = "tbl_user";
    $fields = array("FullName", "Email", "Password");
    $values = array($FullName, $Email, $Password);
    $result = insertData($table, $fields, $values,$connect);
    if($result)
    {
        echo "data inserted";
    }
    echo "data is not inserted";
}

刀片

public function add_filling_detail(Request $request)

{

$this->validate($request, [

'image_path' => 'required|mimes:doc,docx,pdf,jpeg,jpg,png|max:2048'

]);

$image_path = $request->file('image_path');

$new_name = rand() . '.' . $image_path->getClientOriginalExtension();

Oil_Filling::create([


'image_path' => $image_path->move('filling_images', $new_name),

]);

return redirect('admin/filing_list');

}

0 个答案:

没有答案