getting images from array

Hi

I have this kind of code source for uplaodin an image. from controller: def uploadFile     @text = "File has been uploaded successfully"

    post = DataFile.save(params[:upload])     render :text => @text

end

from model: def self.save(upload)     name = upload['datafile'].original_filename     directory = "public/data"     #Creating the file path     path = File.join(directory, name)     #write the file     File.open(path,"wb"){ |f| f.write(upload['datafile'].read) } end

But variable upload should be sent on array in new version. If i wan't to go through that array what is the easist way. Do i have to do just loop. I am newbie on rails so i am lit bit confused about the dynamic variables.

http://clarkware.com/cgi/blosxom/2007/02/24, this might help.

and yes, if you want to accept an array instead of a variable, then you would need to loop through it so that you can save many images;

== controller

def upload_file # please don't camel case    images = params[:images]    #do your stuff    Model.save images end

=== model

def self.save images   images.each do |image|     # save files   end end

But i strongly suggest you do it the rails way, as the files will be much easier to manage.

Thanks for replay. I have to tried it by rails way.