From: Nuralanur@... Date: 2006-03-18T17:35:42+09:00 Subject: Re: validation of form whoch is a image -------------------------------1142670921 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Dear Michael, You can check the file properties a user submits using the free external software Imagemagick, which has a method 'identify' to it, _http://www.imagemagick.org/script/identify.php_ (http://www.imagemagick.org/script/identify.php) . If it's a valid format, you get,e.g., identify rose.jpg rose.jpg JPEG 640x480 DirectClass 87kb 0.050u 0:01 or else identify my_ruby_script.rb # (no image file) identify: No decode delegate for this image format (my_ruby_script.rb) and you can check on the responses whta to do next. Imagemagick is a very powerful toolset for image treatment, you can download it at the website above. There are Ruby bindings available at _http://rmagick.rubyforge.org_ (http://rmagick.rubyforge.org) . (I haven't checked whether 'identify' is among them, but if not, you can still talk to Imagemagick as an external program, using backticks or the system command or the open3 library.) Please tell us about your luck in doing so ;-) Best regards, Axel -------------------------------1142670921--