REST API中的Codeigniter图片上传问题

时间:2018-09-05 05:38:20

标签: php codeigniter

我在codeigniter 3中上载图片时遇到问题。当我使用邮递员上载图片时,它的工作正常。当android发出的请求出现错误the filetype is not allowed时,该怎么办。当我进一步签入upload.php时库似乎没有处理文件扩展。我上传libray的配置是:

$config['allowed_types']='jpg|png|jpeg';

并且来自android的请求是(发布和文件数据)

{
  "post": 
    {
     "user_id":"1003",
     "car_id":"1",
     "address":"xxdrtxr",
     "location":"Delhi",
     "loaner_vehicle":"1",
     "enquiry":"fdf",
     "service_type":"1",
     "pick_up_date":"13\/9\/2018",
     "pick_up_time":"01-02 PM",
     "latitude":"30.6967858",
     "longitude":"76.6877732"
   },
  "files":{
     "service_images":
     {
       "name":["20180904_164537.jpg","20180904_164329.jpg"],
       "type":["multipart\/form-data","multipart\/form-data"],
       "tmp_name":["\/tmp\/phpdCkPPH","\/tmp\/phptvFq7C"],
       "error":[0,0],"size":[1077267,782637]
      }
   }
 }

0 个答案:

没有答案