Hi, I am using attachment_fu plugin for uploading files. Can anybody tell me how to access the filename in the Model before the file gets uploaded ? Actually I want to a system where the users will be able to upload files if the filenames matches with the existing filenames already stored in a different table. Can anybody advice me on how to solve this problem ? Thanks Saurav -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
as far as i understand, using attachment_fu, you cannot get the filename in the Model BEFORE the file gets uploaded. One solution to you problem could be : i. Make the use enter the filename (or path) in a textfield. ii. Make an ajax call to the server with the filename, to verify whether it exists in the database. iii. Enable the upload button / display error message depending on the result of the ajax call. On Jul 10, 3:10 pm, Saurav Chakraborty <rails-mailing-l...@andreas- s.net> wrote:> Hi, > > I am using attachment_fu plugin for uploading files. Can anybody tell me > how to access the filename in the Model before the file gets uploaded ? > Actually I want to a system where the users will be able to upload files > if the filenames matches with the existing filenames already stored in a > different table. Can anybody advice me on how to solve this problem ? > > Thanks > Saurav > -- > Posted viahttp://www.ruby-forum.com/a--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanx for the solution.BTW is there any other plugin which will allow me to capture the filename before it gets uploaded in the database ?? Saurav Unnikrishnan Kp wrote:> as far as i understand, using attachment_fu, you cannot get the > filename in the Model BEFORE the file gets uploaded. > > One solution to you problem could be : > > i. Make the use enter the filename (or path) in a textfield. > ii. Make an ajax call to the server with the filename, to verify > whether it exists in the database. > iii. Enable the upload button / display error message depending on the > result of the ajax call. > > On Jul 10, 3:10 pm, Saurav Chakraborty <rails-mailing-l...@andreas--- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---