Dear all,

I have uploaded gif images and stored in folder called banner list. I
have successfully read and written the uploaded gif files even animated
gif files. But when i read the same gif file from the the bannerlist
folder and write in banner folder, i was not able to do so. Please
suggest on how to read gif images from a folder and write in another
folder.

I have used code :

if File.exists? RAILS_ROOT + "/public/images/bannerlist/#{params[:id]}"

  a = File.read("public/images/bannerlist/martin2.gif")

  File.open("public/images/banner/" + "banner.gif" , "wb") do |f|

      f.write(a)

  end
end

For Uploading of images i have used following code and it works fine, so
please suggest on the above issue of reading and writing of animated gif
files from one folder to another.

image = params[:image][:blob]

image1=params[:image][:blob].original_filename

File.open(RAILS_ROOT + "/public/images/bannerlist/" + image1, "wb") do
|f|

  f.write(params[:image][:blob].read)

end

please suggest a way for reading and writing of animated gif files from
one folder to another.

Thanks in advance

Regards,
Jose
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to