如何在刀片上解析多个Json数据文件/图像

时间:2019-04-24 04:52:37

标签: json laravel parsing

我输入了JSON数据,因为我想在1个字段上添加多个数据文件或图像:

#attributes: array:3 [▼
"No_RM" => "0932595"
"file_Data_Pasien" => "["file1.pdf"]"
"file_SEP_SBT" => "["file2.pdf","file4.pdf","file3.pdf"]"]
从我的输入中

dd。并将保存在数据库中。在此Json中没有“ KEY”,

    <form method="post" action="{{url('file')}}" enctype="multipart/form-data">
  {{csrf_field()}}


        <div class="input-group control-group increment" >

          <div class="input-group-btn">

                <input type="text" name="No_RM" class="form-control" placeholder="Masukan No Rekam Medis">
                <input type="file" name="filename[]" class="form-control" placeholder="Masukan File">
                <input type="file" name="filesep[]" class="form-control" placeholder="Masukan File">  
            <button class="btn btn-success" type="button"><i class="glyphicon glyphicon-plus"></i>Add</button>
          </div>
        </div>
        <div class="clone hide">
          <div class="control-group input-group" style="margin-top:10px">

            <div class="input-group-btn"> 

                    <input type="file" name="filesep[]" class="form-control">
              <button class="btn btn-danger" type="button"><i class="glyphicon glyphicon-remove"></i> Remove</button>
            </div>
          </div>
        </div>

        <button type="submit" class="btn btn-primary" style="margin-top:10px">Submit</button>

  </form> 
  1. 如何添加密钥,例如{“ data”:“ file1.pdf”}
  2. 我如何在视图上解析此内容?我尝试添加PATH a href,但无法解析此 http://localhost:8000/files/[“ file2.pdf”,“ file3.pdf”,]

0 个答案:

没有答案