I would like my uploadFormPage() function to be able to take jpegs and pdf's. Is it possible for me to have 2 file types for the same FormData() const?`
export function uploadFormPage(documentId, formId, file, callback) { return async dispatch => {try { const formData = new FormData(); formData.append('page', { name: `document-${documentId}-${formId}-${Date.now()}.jpg`, type: 'image/jpeg', uri: file, }); const result = await Api.uploadFiles(formData); const entity = { id: formId, resourceKey: result.page, }; const rsp = await Api.uploadFormPage(documentId, entity); dispatch({type: LOAD_DOCUMENTS, data: rsp}); callback(null, rsp);} catch (e) { callback(e, null);}};}