# Create image function throwing form data error

**URL:** <https://forum.social.plus/t/create-image-function-throwing-form-data-error/457>\
**Category:** General\
**Created:** [June 24, 2022, 8:35am UTC](https://forum.social.plus/t/create-image-function-throwing-form-data-error/457 "2022-06-24T08:35:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshit](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@harshit](https://forum.social.plus/u/harshit)\
**Post date:** [June 24, 2022, 8:35am UTC](https://forum.social.plus/t/create-image-function-throwing-form-data-error/457/1 "2022-06-24T08:35:22Z")

</div>

I am using ts SDK in react native application and getting following error.  
{“data”: undefined, “error”: [TypeError: formData.getAll is not a function. (In ‘formData.getAll(‘files’)’, ‘formData.getAll’ is undefined)], “loading”: false, “origin”: “server”}

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 24, 2022, 9:08am UTC](https://forum.social.plus/t/create-image-function-throwing-form-data-error/457/2 "2022-06-24T09:08:17Z")

</div>

Hi @harshit can you please try this code to create img [File Handling - Amity Docs](https://docs.amity.co/chat/typescript/file-handling#create-image)

Please note that before you attach files in messages, posts user and community avatars, you need to create the file first using the `createFile,` `createImage or createVideo ` methods. In case you’re using sdk with React Native you should use [https://github.com/AmityCo/react-native-formdata-polyfill](https://react-native-formdata-polyfill)

---

<div class="post-metadata">

**Author:** ![harshit](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@harshit](https://forum.social.plus/u/harshit)\
**Post date:** [June 24, 2022, 1:30pm UTC](https://forum.social.plus/t/create-image-function-throwing-form-data-error/457/3 "2022-06-24T13:30:26Z")

</div>

yes now it is uploading but the image quality is too low so what parameter is required to increase image quality?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [June 24, 2022, 1:41pm UTC](https://forum.social.plus/t/create-image-function-throwing-form-data-error/457/4 "2022-06-24T13:41:18Z")

</div>

@harshit Please append **?size=large** to get bigger size and better quality
