You should set the correct MIME type (and extension) to allow Firefox to recognise what kind of file is being downloaded:
send_file "#{RAILS_ROOT}/#{@document.path}", :type => "application/pdf",
:filename => "document.pdf"
You can read and store this information when the file is being uploaded.
uploaded_file.content_type # the uploaded file's MIME type
uploaded_file.original_path # name of the file
Even then, if the MIME type is unknown, I don't think you'll get an Open with prompt. So ultimately this will also depend on the particular kinds of files you are using in your application.
molf
2010-07-27 06:45:08