文件名不能为空

时间:2015-04-30 11:03:14

标签: php file upload

几个星期前,我有这个代码将文件上传到我的数据库,但现在不起作用

输入:

{
  "_id": "393c7748cf487f7c5223839dfdf5adf9",
  "_rev": "2-889c6d9d14fcc3c90a00e91aca5f2f4c",
  "name": "conference 1",
  "type": "conference",
  "location": "conf loc",
  "tag": "confTag",
  "startDate": "2015-05-04T22:00:00.000+0000",
  "endDate": "2015-05-08T22:00:00.000+0000",
  "timeslots": {
    "8a03b160-48e3-4f99-be38-2a2da34e5890": {
      "id": "8a03b160-48e3-4f99-be38-2a2da34e5890",
      "startDate": "2015-04-07T10:45:00.000+0000",
      "endDate": "2015-05-07T12:45:00.000+0000",
      "location": "Location",
      "topic": {
        "id": "4ad235ef-5938-4461-8a2e-346bf105c5b6",
        "title": "wa nen coole title",
        "description": "dees is een goei omschrijving",
        "tags": "cloud, tag",
        "attachment": "file.exe",
        "speakerId": null
      }
    },
    "a59b1dfd-d1c5-491f-bc02-807e38595ba4": {
      "id": "a59b1dfd-d1c5-491f-bc02-807e38595ba4",
      "startDate": "2015-05-05T10:00:00.000+0000",
      "endDate": "2015-05-05T11:15:00.000+0000",
      "location": "mlkjs",
      "topic": {
        "id": "8b753adb-9a15-486f-9209-b9cc5ef134a1",
        "title": "test132",
        "description": "met speakerId",
        "tags": "sldkjf",
        "attachment": "kklsjdf",
        "speakerId": "speaker"
      }
    },
    "080153e7-f8bc-453e-b49a-a1df4679ceef": {
      "id": "080153e7-f8bc-453e-b49a-a1df4679ceef",
      "startDate": "2015-05-09T11:30:00.000+0000",
      "endDate": "2015-05-09T13:30:00.000+0000",
      "location": "file upload",
      "topic": {
        "id": "e3533a60-a0ba-4439-a9e9-b29e69be47db",
        "title": "fdgdfg",
        "description": "fdsgdsggdfgdfg",
        "tags": "dfgsdg",
        "attachment": null,
        "speakerId": null
      }
    }
  },
  "defaultTwitterText": "Hallo",
  "twitterUrl": "https://twitter.com/intent/tweet?button_hashtag=confTag&text=Hallo"
}

上传文件的.php(与数据库的连接)

function(doc) {
{ if (doc.type === 'conference') {
    if(doc.timeslots.size !==0 ){
            emit( null, doc);
        }
    }
  }
}

2 个答案:

答案 0 :(得分:-1)

哪里显示错误?在插入?如果你说它过去有效,那么表格的结构可能会改变。

答案 1 :(得分:-1)

您有一个浏览文件的按钮。您需要另一个发布表单。像

这样的东西
echo "<input $class type='submit' value='submit' name='$name' id='$name'>"
相关问题