# Automatically saving files

**URL:** <https://discourse.mitmproxy.org/t/automatically-saving-files/44>\
**Category:** Uncategorized\
**Created:** [June 15, 2016, 1:54pm UTC](https://discourse.mitmproxy.org/t/automatically-saving-files/44 "2016-06-15T13:54:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackandjohn](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jackandjohn](https://discourse.mitmproxy.org/u/jackandjohn)\
**Post date:** [June 15, 2016, 1:54pm UTC](https://discourse.mitmproxy.org/t/automatically-saving-files/44/1 "2016-06-15T13:54:15Z")

</div>

I’m guessing the best place to do this is in a script, but I’m feeling the newbie crunch and can’t figure it out.

What I’m looking for simply is to transparently save all intercepted files (images, zips, etc) to the local filesystem.

As a nice bonus, I’d like to be able to save them to folders based on the device that requested it.

Thanks in advance, mitmproxy has leapfrogged my knowledge more than a few times.

---

<div class="post-metadata">

**Author:** ![mhils](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/mhils/32/7_2.png) [@mhils](https://discourse.mitmproxy.org/u/mhils)\
**Post date:** [June 21, 2016, 4:47am UTC](https://discourse.mitmproxy.org/t/automatically-saving-files/44/2 "2016-06-21T04:47:10Z")

</div>

Hi @jackandjohn,

I built something like this a loooong time ago: [https://github.com/mhils/mitmproxy/blob/integrate\_honeyproxy/scripts/core/dirdumper.py](https://github.com/mhils/mitmproxy/blob/integrate_honeyproxy/scripts/core/dirdumper.py)  
There’s probably some dust that needs to be removed, but other than that this should match your needs. If you’re going to make this work again, I’d be happy to see a Pull Request that adds it to our official examples! 🙂
