# Any maximum file size using event.file.copyTo for file uploads?

**URL:** <https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235>\
**Category:** Ignition\
**Created:** [November 18, 2021, 1:33pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235 "2021-11-18T13:33:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuek](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kuek](https://forum.inductiveautomation.com/u/kuek)\
**Post date:** [November 18, 2021, 1:33pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/1 "2021-11-18T13:33:45Z")

</div>

I was using file upload to allow users to upload images and save it in Gateway locally using event.file.copyTo(filename). However, when file size is more than 1MB, file was not saved. Upload component was showing successfully uploaded. Does anyone have similar encounter? Any recommendations on the solution?

Tried pdf files and it’s the same.  
File size limit is set at 10MB  
Ignition 8.1.11 running on Ubuntu 20.04

Thanks.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 18, 2021, 3:32pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/2 "2021-11-18T15:32:16Z")

</div>

Check your gateway logs for any errors.  
Also, can you share your exact script?

---

<div class="post-metadata">

**Author:** ![kuek](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kuek](https://forum.inductiveautomation.com/u/kuek)\
**Post date:** [November 18, 2021, 4:18pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/3 "2021-11-18T16:18:46Z")

</div>

There isn’t any wrapper logs with regards to file upload when uploading a file more than 1MB.

My event script is:  
path = “/home/user/images/marketing/”  
filename = path + event.file.name  
event.file.copyTo(filename)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 18, 2021, 5:17pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/4 "2021-11-18T17:17:25Z")

</div>

Hmm, there might be an implicit maximum file size imposed by Jetty, though I would expect that to trigger something in the logs. Are these file uploads being triggered on a desktop computer, or a mobile device? Any chance you could wireshark the upload request?

There's some configuration you can do to Jetty, though again, I'm not sure this is even the source of the problem:

> [@\[Perspective\] Project Import Failing](https://forum.inductiveautomation.com/t/perspective-project-import-failing/51884/4):
>
> I think the default max upload size is ~21mb… You’ll have to modify the web.xml file and restart the gateway to increase it. In $IGNITION/webserver/webapps/main/WEB-INF/web.xml there’s a section like this: \<servlet\> \<servlet-name\>DataRoutes\</servlet-name\> \<servlet-class\>com.inductiveautomation.ignition.gateway.dataroutes.DataServlet\</servlet-class\> \<load-on-startup\>1\</load-on-startup\> \<multipart-config\> \<max-file-size\>20848820\</max-file-size\> \<max-request-size\>418…

---

<div class="post-metadata">

**Author:** ![kuek](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kuek](https://forum.inductiveautomation.com/u/kuek)\
**Post date:** [November 18, 2021, 5:54pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/5 "2021-11-18T17:54:42Z")

</div>

The uploads are to triggered on desktop computer while I have also tried the same from an iPhone.

I’ve changed as below, restart the gateway. But it’s still the same for a file size of 1.3MB.  
  
20848820  
418018841  
**2048576**

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 18, 2021, 6:15pm UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/6 "2021-11-18T18:15:47Z")

</div>

I was just able to upload a 175mB file to a remote host running 8.1.11 (and no customizations to web.xml, etc) with no issues. You may need to investigate your network further with Wireshark.

---

<div class="post-metadata">

**Author:** ![kuek](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kuek](https://forum.inductiveautomation.com/u/kuek)\
**Post date:** [November 19, 2021, 6:54am UTC](https://forum.inductiveautomation.com/t/any-maximum-file-size-using-event-file-copyto-for-file-uploads/53235/7 "2021-11-19T06:54:28Z")

</div>

I managed to solve the problem. I’m running the gateway behind a Nginx reverse proxy and by default, the maximum upload file size is 1MB. I just need to add the below statement inside server{} to increase the limit.  
client\_max\_body\_size 15M;

Thanks for helping.
