尝试通过PHP向Desire2Learn学习套件提交文件到Dropbox。我没有看到记录中包含该文件的字段名称。我是不是遗漏了什么?
发布于 2012-06-29 05:13:36
不,你没有遗漏什么。dropbox提交的文件没有字段名称。在发布提交文件时,将name属性保留为空字符串。
下面是提交请求应该是什么样子:
POST http://{domain_name}/d2l/api/le/{version}/{org_unit}/dropbox/folders/{folder_id}/submissions/mysubmissions/?x_a={app_id}&x_b={token_id}&x_d={token_sig}&x_c={app_sig}&x_t={time} HTTP/1.1
Content-Type: multipart/mixed; boundary=8cf23611201b7ae
Host: {domain_name}
Content-Length: 775926
--8cf23611201b7ae
Content-Type: application/json
{"Text":"Here you go","HTML":null}
--8cf23611201b7ae
Content-Disposition: form-data; name=""; filename="Jellyfish.jpg"
Content-Type: image/jpeg
{binary data}
--8cf23611201b7ae--https://stackoverflow.com/questions/11252025
复制相似问题