1
파일을 만들 때 CouchDB 문서에 첨부하려고합니다. 난CouchDB, Kanso, 파일 업로드 오류
{"error":"doc_validation","reason":"Bad special document member: _attachments"}
:
<form>
<input type="hidden" name="type" value="devtest"/>
<input type="file" name="_attachments" id="picture" accept="image/*" multiple/>
<button type="submit">Go</button>
</form>
이
은 JS 코드는 업로드$(document).on('submit', 'form', function(e) {
e.preventDefault();
var formdata = $(this).serializeObject(); // Provided by a pluign
$(this).find(':file').each(function(k,v) {
formdata[$(this).attr('name')] = $(this).val(); // Treating files
});
// Using the kanso db package
m.db.current().saveDoc(
formdata,
function(err,res) {
console.log('gna');
});
});
이 다음과 같은 오류 (500) 메시지를 생성을 처리 :
이
는 HTML 코드 kanso 0.2.2 및 db 0.1.0과 함께 CouchDB 1.3.1을 사용합니다.