# Chmod

**URL:** <https://www.ruby-forum.com/t/chmod/95731>\
**Category:** Rails\
**Created:** [June 11, 2006, 6:42am UTC](https://www.ruby-forum.com/t/chmod/95731 "2006-06-11T06:42:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nhila\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/5daacb/32.png) [@Nhila\_D](https://www.ruby-forum.com/u/Nhila_D)\
**Post date:** [June 11, 2006, 6:42am UTC](https://www.ruby-forum.com/t/chmod/95731/1 "2006-06-11T06:42:53Z")

</div>

hi everybody, after some time dealing with file upload finally i have my  
scvript working, the problem its that seems that the files are uploaded  
with 600 permissions and i need to be 644 to be accesible to everyone.

So i tried to change the permisions of the files inside the folder where  
are saved the uploaded files, i have this on the index action of my  
controller so at fisrt time change the permissions when needed:

Dir["/public/images/publics/\*"].each {|f| FileUtils.chmod(0664, f)}

But doesnt seems to work, no error or warnings and the files remains  
with the old permissions and i have to change it manually by ftp, if  
someone can give me a hand with how to change permissions inside a  
folder from a controller ill be very happy and your help will be very  
appreciated cause i have tried a lot and i cant make it work ☹

---

<div class="post-metadata">

**Author:** ![Nhila\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/5daacb/32.png) [@Nhila\_D](https://www.ruby-forum.com/u/Nhila_D)\
**Post date:** [June 11, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/chmod/95731/2 "2006-06-11T21:18:28Z")

</div>

Anyone? im stuck with this by 4 days now, i cant find a working example  
in how to change file permissions, really if someone can help with this  
ill be very very thankful.

Nhila 🙂

---

<div class="post-metadata">

**Author:** ![Nhila\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/5daacb/32.png) [@Nhila\_D](https://www.ruby-forum.com/u/Nhila_D)\
**Post date:** [June 11, 2006, 9:38pm UTC](https://www.ruby-forum.com/t/chmod/95731/3 "2006-06-11T21:38:27Z")

</div>

[http://tinyurl.com/klhy3](http://tinyurl.com/klhy3)

The second major entry should get you where you’re going.

Is it possible you spent 4 days without using Google?

If so let me humbly recommend that you pull the Google  
trigger sooner next time.

–  
– Tom M.
