How can I know if a file has been attached?

Assuming Rails 2.2 or higher:

if params[:post_attachment][:file].present?
  # do file upload here
end

If Rails 2.1 or earlier,

unless params[:post_attachment][:file].blank?
  # do file upload here
end

Does this help?

Jeff

purpleworkshops.com
switchingtorails.com