We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I lost many time on non working multi file upload, I was surprised why it's not supported. Moreover, fix is trivial, something like
[ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key]; if (Array.isArray(property) && property.every(p => p instanceof Blob)) { property.forEach(p => formData.append(key, p)); } else { formData.append( key, property instanceof Blob ? property : typeof property === 'object' && property !== null ? JSON.stringify(property) : `${property}`, ); } return formData; }, new FormData()),
Originally posted by @darky in #815 (comment)
The text was updated successfully, but these errors were encountered:
I have a similar issue in React Native but I use uri with local system files so I added one more check:
uri
[ContentType.FormData]: (input: any) => Object.keys(input || {}).reduce((formData, key) => { const property = input[key] if (Array.isArray(property) && property.every((p) => 'uri' in p)) { property.forEach((p) => formData.append(key, p)) } else if (Array.isArray(property) && property.every((p) => p instanceof Blob)) { property.forEach((p) => formData.append(key, p)) } else { formData.append( key, property instanceof Blob ? property : typeof property === 'object' && property !== null ? JSON.stringify(property) : `${property}`, ) } return formData }, new FormData()),
Sorry, something went wrong.
No branches or pull requests
When I lost many time on non working multi file upload, I was surprised why it's not supported. Moreover, fix is trivial, something like
Originally posted by @darky in #815 (comment)
The text was updated successfully, but these errors were encountered: