hey,
i have a submit form, where u can upload a file (only photos)
this i my code
def create
@fsimage = Fsimage.new(params[:fsimage])
parent_id = params[:parent_id]
parent_class = params[:parent_class]
url = params[:url]
file = params[:file][:file]
original_filename = file.original_filename
@fsimage.filename = original_filename
arr_filetype = original_filename.split(".")
@fsimage.filetype = arr_filetype[arr_filetype.length - 1]
parent_object = parent_class.constantize.find(parent_id)
#TODO setting order
index_col = 0
images = parent_object.fsimages
for image in images
if image.index_col > index_col
index_col = image.index_col
end
end
index_col += 1
@fsimage.index_col = index_col
if parent_object != nil && @fsimage.save
parent_object.fsimages << @fsimage
filename_on_system = SaveImageFiletoDisk(file, @fsimage)
if filename_on_system == nil
Dir.delete(getImageStorageDir() + "/" + @fsimage.id.to_s)
Fsimage.find(@fsimage.id).destroy
else
@fsimage.filesize = File.size(filename_on_system)
@fsimage.filename = filename_on_system.gsub("public", "")
=>>>>>>> WIDTH AND HEIGHT
@fsimage.save
end
flash[:notice] = ''Image was successfully created.''
redirect_to url
else
render :action => ''new''
end
end
How can i get the width and the height of the file?
--
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
-~----------~----~----~----~------~----~------~--~---