doumeinuoye81969 2016-12-23 13:04
浏览 55

在PUT中请求如何在codeigniter 3中检索数据

I'm sending data as http PUT request. Using Postman I have chosen form-data as option to send data as I want to send(upload) file as well,along with other necessary data.

I have chosen a csv file and a field with name(key) as "asd". In output window data is displayed as below :

So my question is : how to retrieve or receive the data in codeigniter 3 with key name asd and input type file's key name fil?

I tried:

$this->input->raw_input_stream('asd');
$this->input->raw_input_stream('fil');

But it didn't work.

------WebKitFormBoundaryNXgITT259B576h8U
Content-Disposition: form-data; name="asd"

zxxxxxxxxxxxx

------WebKitFormBoundaryNXgITT259B576h8U
Content-Disposition: form-data; name="fil"; filename="utility_type.csv"
Content-Type: text/csv

Uid,Description,Modified
3,"Water and Sewer","2009-10-08 20:49:46"
2,"Combined Services","2014-07-29 14:50:32"
4,Electric,"2011-08-30 20:12:52"
5,"Natural Gas","0000-00-00 00:00:00"
6,Cable/Internet,"2015-06-10 17:47:51"
7,"Solid Waste/Trash Collection","2009-07-09 21:19:38"
30,Sewer,"2012-05-28 11:57:32"
80,Water,"2016-10-26 17:09:57"

------WebKitFormBoundaryNXgITT259B576h8U--
  • 写回答

1条回答 默认 最新

  • dsvtnz6350 2016-12-23 15:08
    关注

    If it is a HTTP request you could use:

    file_get_contents('php://input')

    It will return the HTTP body.

    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用