Hi @Platform_Team !
I’m not getting the file name when posting an attachment to the server. The request I’m sending is:
export function createAttachment(patientUuid: string, file: UploadedFile) {
const formData = new FormData();
const emptyFile = new File([''], file.fileName);
formData.append('fileCaption', file.fileDescription);
formData.append('patient', patientUuid);
formData.append('file', emptyFile);
formData.append('base64Content', file.fileContent);
console.log('saving file', file);
return openmrsFetch(`${attachmentUrl}`, {
method: 'POST',
body: formData,
});
}
I’m getting the fileCaption in form of comment from the response, but I’m not getting the file name that I’m sending. Attachment url: /ws/rest/v1/attachment Thank you.