Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
To reliably upload files to QuickBase don't use the API and don't use any addon or external service.
Use the FormData and the Fetch API (features which are already in your browser) and hijack QuickBase's non-API method a=FinishEditRecord.
This tiny fragment of code is all you need to upload a file selected through an <input type=file name=_fid_6> element:
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=594
The following screenshots demonstrate that you can use this code to upload a selected file using script WITHOUT pressing the green SAVE button:
Note the console is displaying the Response URL ?a=dr for the newly created record containing the file attachment filed seen below:
Also note that I am just borrowing QuickBase's form which happens to have a <input type=file name=_fid_6> element on it. The code in no way need to use QuickBase's form - you can do the same thing by just dropping the <input type=file name=_fid_6>onto a code page and incorporating the short script I listed above..
FormData Info
https://developer.mozilla.org/en-US/docs/Web/API/FormData
Fetch API Info
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
All things considered (including the current state of QuickBase's architecture), every other solution is inferior to this method. STOP doing things the old way and use script for everything you can. There has been so much enormous progress made with browser technologies that you will simply not be participate in this revolution if you do not avail yourself of the cornucopia of technology already installed on your device.
Use the FormData and the Fetch API (features which are already in your browser) and hijack QuickBase's non-API method a=FinishEditRecord.
This tiny fragment of code is all you need to upload a file selected through an <input type=file name=_fid_6> element:
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=594
The following screenshots demonstrate that you can use this code to upload a selected file using script WITHOUT pressing the green SAVE button:
Note the console is displaying the Response URL ?a=dr for the newly created record containing the file attachment filed seen below:
Also note that I am just borrowing QuickBase's form which happens to have a <input type=file name=_fid_6> element on it. The code in no way need to use QuickBase's form - you can do the same thing by just dropping the <input type=file name=_fid_6>onto a code page and incorporating the short script I listed above..
FormData Info
https://developer.mozilla.org/en-US/docs/Web/API/FormData
Fetch API Info
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
All things considered (including the current state of QuickBase's architecture), every other solution is inferior to this method. STOP doing things the old way and use script for everything you can. There has been so much enormous progress made with browser technologies that you will simply not be participate in this revolution if you do not avail yourself of the cornucopia of technology already installed on your device.