Continuing the discussion from Multiple Files & Upload Preview:
Working Demo Here
Looking for a little direction here.
@Chem or @moe, maybe you could chime in here if you have time.
I was able to get a drag and drop file upload library working on a page but I’m stuck now. I used FilePond.
I don’t know what to do with the file once it’s been added to the upload section.
How do I create a record with it, or add it to a record?
Edit: I’ve been messing around with trying to upload a file/image with the Tadabase API. I see that images are not able to be uploaded - side note: why not? will this be changed in the future?
Anyways, I suppose I could still save the image as a file but I’m struggling with the code. I’m referencing this from developer.tadabase.com
var form = new FormData();
form.append("field_55", fileInput.files[0], "mockup1.jpg");
var settings = {
"url": "https://api.tadabase.io/api/v1/data-tables/{{tableId}}/records",
"method": "POST",
"timeout": 0,
"headers": {
"X-Tadabase-App-id": "{{appId}}",
"X-Tadabase-App-Key": "{{appKey}}",
"X-Tadabase-App-Secret": "{{appSecret}}"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});
And trying to mash it together with this from FilePond…
FilePond.setOptions({
server: {
url: 'http://192.168.0.100',
process: {
url: './process',
method: 'POST',
withCredentials: false,
headers: {},
timeout: 7000,
onload: null,
onerror: null,
ondata: null
}
}
});