# Mongrel error on read file after upload

**URL:** <https://discuss.rubyonrails.org/t/mongrel-error-on-read-file-after-upload/42753>\
**Category:** rubyonrails-talk\
**Created:** [May 22, 2009, 9:32am UTC](https://discuss.rubyonrails.org/t/mongrel-error-on-read-file-after-upload/42753 "2009-05-22T09:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [May 22, 2009, 9:32am UTC](https://discuss.rubyonrails.org/t/mongrel-error-on-read-file-after-upload/42753/1 "2009-05-22T09:32:31Z")

</div>

I have a java client that uploads files to a web server. The problem is that whenever the client uploads a file, and mongrel saves it in a temporary file (in this case, mongrel13800-0), mongrel can't read the file resulting in the error below.

Read error: #\<Errno::EACCES: Permission denied - /home/Jim/work/tmp/mongrel3800-0\>

pastie link here: [http://pastie.org/486246](http://pastie.org/486246)

i've resolved the problem by setting Mongrel::Const::MAX\_BODY to 5MB, but i don't really like that solution. And I have no control over the size of the uploads.

i've tried chmod and chown but it doesn't solve the problem. any ideas? thanks!

---

<div class="post-metadata">

**Author:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [May 22, 2009, 12:10pm UTC](https://discuss.rubyonrails.org/t/mongrel-error-on-read-file-after-upload/42753/2 "2009-05-22T12:10:25Z")

</div>

> I have a java client that uploads files to a web server. The problem is that whenever the client uploads a file, and mongrel saves it in a temporary file (in this case, mongrel13800-0), mongrel can't read the file resulting in the error below.

Does the java code run as a different user than your mongrel ?

Fred

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [May 25, 2009, 12:52am UTC](https://discuss.rubyonrails.org/t/mongrel-error-on-read-file-after-upload/42753/3 "2009-05-25T00:52:18Z")

</div>

Frederick Cheung wrote:
