# Uploading image file as base64

**URL:** <https://forums.fusetools.com/t/uploading-image-file-as-base64/3641>\
**Category:** How-to Discussions\
**Created:** [September 12, 2017, 8:19am UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641 "2017-09-12T08:19:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferdinand.berthelsen](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@ferdinand.berthelsen](https://forums.fusetools.com/u/ferdinand.berthelsen)\
**Post date:** [September 12, 2017, 8:19am UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641/1 "2017-09-12T08:19:12Z")

</div>

Hello.  
I want to upload images from the camera roll and device camera to my server.  
Lighter images from the camera roll (downloaded) are not a problem to pass, but heavier images taken with the device camera generate a base64 string too big for the server (PHP) to catch (413 Request Entity Too Large). My server is hosted by Domeneshop (Domainnameshop) and they do not provide access to php.ini which would’ve made for a quick fix (increasing the allowed limit of characters).  
How do you reckon I go about this issue?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [September 13, 2017, 9:34am UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641/2 "2017-09-13T09:34:01Z")

</div>

Please check if [one of these suggestions](https://www.fusetools.com/community/forums/show_and_tell/multipart_image_uploader_module?page=1&highlight=133a1e85-8adb-4c65-9993-e41745b28029#post-133a1e85-8adb-4c65-9993-e41745b28029) could help you.

---

<div class="post-metadata">

**Author:** ![ferdinand.berthelsen](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@ferdinand.berthelsen](https://forums.fusetools.com/u/ferdinand.berthelsen)\
**Post date:** [September 15, 2017, 9:01am UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641/3 "2017-09-15T09:01:26Z")

</div>

Ok thank you!  
But if I use Anders Bondehagen’s first example using fetch, will the image be sent by POST as a part of $\_FILES as a file?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [September 15, 2017, 9:06am UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641/4 "2017-09-15T09:06:13Z")

</div>

Judging from the following line, it will be sent by POST, yes.

```auto
fetch('http://<your_uri>', { method: "POST", body: buffer });

```

As for the $\_FILES part, I really don’t know; is that a PHP thing? The `buffer` there comes from [ImageTools.getBufferFromImage](https://www.fusetools.com/docs/fuse/imagetools/imagetools/bufferfromimageinterface_95a738ba) so maybe knowing that helps you?

---

<div class="post-metadata">

**Author:** ![ferdinand.berthelsen](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@ferdinand.berthelsen](https://forums.fusetools.com/u/ferdinand.berthelsen)\
**Post date:** [September 15, 2017, 10:25am UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641/5 "2017-09-15T10:25:39Z")

</div>

Yes $\_FILES is a PHP thing to grab **files** submitted from a form. From what I can tell by googling “ArrayBuffer” it seems like the image is converted into an array instead of a base64 string, so this might work. I’ll give it a try and let you know the result

---

<div class="post-metadata">

**Author:** ![Daniel\_Res](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@Daniel\_Res](https://forums.fusetools.com/u/Daniel_Res)\
**Post date:** [December 19, 2017, 5:47pm UTC](https://forums.fusetools.com/t/uploading-image-file-as-base64/3641/6 "2017-12-19T17:47:12Z")

</div>

Hello  
Will it have succeeded on the server side?  
could you help me?
