【问题标题】:How to send base64 image from angularjs to laravel using POST method? [duplicate]如何使用 POST 方法将 base64 图像从 angularjs 发送到 laravel? [复制]
【发布时间】:2018-05-12 10:33:32
【问题描述】:

您好,我是 laravel 和 angularjs 的新手。我的疑问是如何将上传的图片(转换 base64)发送到 laravel

我的 html 代码如下所示

<input type="file" class="upload upload-button" fileinput="fileinput"
       filepreview="image" file-model = "myFile">

给出一些想法,因为我想在数据库中存储 blob(图像)。

【问题讨论】:

    标签: angularjs laravel


    【解决方案1】:
     $image_parts = explode(";base64,", $request->input('profile_pic')); $image_base64 = base64_decode($image_parts[1]);
    
    
     Storage::put('user_profile/croped/' . myimage.jpg, (string) $image_base64, 'public');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-01
      • 1970-01-01
      • 2018-09-28
      • 2013-02-04
      相关资源
      最近更新 更多