# File\_column uppercase extension problem

**URL:** <https://www.ruby-forum.com/t/file-column-uppercase-extension-problem/74119>\
**Category:** Rails\
**Created:** [October 30, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/file-column-uppercase-extension-problem/74119 "2006-10-30T18:29:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![George](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71e660/32.png) [@George](https://www.ruby-forum.com/u/George)\
**Post date:** [October 30, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/file-column-uppercase-extension-problem/74119/1 "2006-10-30T18:29:49Z")

</div>

i’m using file\_column 0.3.1 with rails 1.1.6, ruby 1.8.4, on winXP, and  
i have this problem:

when I try to upload in my web application an image using file\_column  
plugin, if the extension of the image contains at least 1 uppercase  
(e.g. myImage.jpG), I get this error:

No such file or directory -  
./public/model/picture/tmp/1162229227.753000.516/myImage.JPG or  
./public/model/picture/tmp/1162229227.753000.516/myImage.jpg

Have you ever had this problem or do you know what’s about?

Thank you

---

<div class="post-metadata">

**Author:** ![George](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71e660/32.png) [@George](https://www.ruby-forum.com/u/George)\
**Post date:** [October 31, 2006, 7:35am UTC](https://www.ruby-forum.com/t/file-column-uppercase-extension-problem/74119/2 "2006-10-31T07:35:00Z")

</div>

I have the same problem, but i didn’t find a solution. I give up… You  
know there’s always a risk when you choose open source software, made by  
some guys late at night, when they come back from work…no guarantee,  
full of bugs, no or very very poor documentation

George wrote:

> i’m using file\_column 0.3.1 with rails 1.1.6, ruby 1.8.4, on winXP, and  
> i have this problem:
> 
> when I try to upload in my web application an image using file\_column  
> plugin, if the extension of the image contains at least 1 uppercase  
> (e.g. myImage.jpG), I get this error:
> 
> No such file or directory -  
> ./public/model/picture/tmp/1162229227.753000.516/myImage.JPG or  
> ./public/model/picture/tmp/1162229227.753000.516/myImage.jpg
> 
> Have you ever had this problem or do you know what’s about?
> 
> Thank you

---

<div class="post-metadata">

**Author:** ![George](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71e660/32.png) [@George](https://www.ruby-forum.com/u/George)\
**Post date:** [October 31, 2006, 9:38am UTC](https://www.ruby-forum.com/t/file-column-uppercase-extension-problem/74119/3 "2006-10-31T09:38:38Z")

</div>

Finnaly, I found this possible solution, taken from  
[http://www.nabble.com/Problems-with-File\_column-t974251.html](http://www.nabble.com/Problems-with-File_column-t974251.html) (!-I didn;t  
check it yet)

If anyone’s still having this problem, I solved it and only just found  
this thread, and thought I’d provide some actual code. It’s a  
one-line fix.

Change

> FileUtils.mv(local\_file\_path, new\_local\_file\_path) unless new\_local\_file\_path == local\_file\_path

to

> FileUtils.mv(local\_file\_path, new\_local\_file\_path) unless new\_local\_file\_path.downcase == local\_file\_path.downcase

The code here is comparing the filename of the original file, and its  
sanitized version. In some cases where there was an uppercase upload,  
your case-(in)sensitive OS will spit an error. This fix doesn’t have  
any negative effect, because we’re just sanitizing filenames, nothing  
else.

The file you have to edit is file\_column.rb.

George wrote:

> i’m using file\_column 0.3.1 with rails 1.1.6, ruby 1.8.4, on winXP, and  
> i have this problem:
> 
> when I try to upload in my web application an image using file\_column  
> plugin, if the extension of the image contains at least 1 uppercase  
> (e.g. myImage.jpG), I get this error:
> 
> No such file or directory -  
> ./public/model/picture/tmp/1162229227.753000.516/myImage.JPG or  
> ./public/model/picture/tmp/1162229227.753000.516/myImage.jpg
> 
> Have you ever had this problem or do you know what’s about?
> 
> Thank you
