# How to reduce uploaded file size?

**URL:** <https://forum.inductiveautomation.com/t/how-to-reduce-uploaded-file-size/32803>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 4, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-reduce-uploaded-file-size/32803 "2020-03-04T14:21:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 4, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-reduce-uploaded-file-size/32803/1 "2020-03-04T14:21:33Z")

</div>

I am trying to upload files using file upload component in perspective, everything works fine. But I want to reduce the size of the file as they get uploaded. Is there any way that I can do it?

Thank You

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 4, 2020, 2:23pm UTC](https://forum.inductiveautomation.com/t/how-to-reduce-uploaded-file-size/32803/2 "2020-03-04T14:23:44Z")

</div>

Before it is transmitted? No.

After it is received? Yes. You can perform any compression or resizing or transformation you like (and can execute in python or with java libraries) before moving the content to your final storage location.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 4, 2020, 2:30pm UTC](https://forum.inductiveautomation.com/t/how-to-reduce-uploaded-file-size/32803/3 "2020-03-04T14:30:43Z")

</div>

I figured out how to reduce size using OpenCV outside ignition but since ignition doesn’t support OpenCV, its not working.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 4, 2020, 2:36pm UTC](https://forum.inductiveautomation.com/t/how-to-reduce-uploaded-file-size/32803/4 "2020-03-04T14:36:46Z")

</div>

Well, part of OpenCV can be used in Ignition via [a third-party module](http://forum.inductiveautomation.com/t/automation-professionals-image-streamer-driver-module/29371)–Mine, actually. (The `cv2` bindings work a bit different in jython vs. python, though, and some features aren’t supported in Java.) However, as noted in the other thread, Java has built-in image manipulation tools, starting with [ImageIO](https://docs.oracle.com/javase/8/docs/api/javax/imageio/ImageIO.html). You can [use these from jython](http://forum.inductiveautomation.com/search?q=ImageIO) by importing the necessary classes.
