Environment: Vue3
Code:
`const isFormData = request.body instanceof FormData;
if (isFormData) {
const formData = new FormData();
let files = [];
if (request.body && typeof request.body.getAll === 'function') {
files = request.body.getAll("files");
} else if (request.files) {
files = request.files;
} else if (request.body && request.body.files) {
files are Array.isArray(request.body.files) ? request.body.files : [request.body.files];
}
if (files.length > 0) {
files.forEach((file, index) => {
formData.append('files', file);
});
}
request.body = formData;
}
request.body = {
messages: [{ role: 'user', text: request.body.messages[0].text }],
};
return request;
`
On Windows Edge,
directly submitting the recording with the attachment works successfully. However,
on iOS, the same behavior fails to attach the file; only by ending the recording first and then submitting does it work.
Is there a solution for this? Thank you.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too