Read document in browser itself

Thorsten M. wrote:

link_to(“whatever”, “/docs/file.doc”)

if file.doc is in a folder named docs in the public folder

what exactly happens in the browser would depend on the users
settings.
most likely the browser would ask him to save it

it will download the file , but i dont want to download the file,
i just want to read the file in browser itself

pls any body reply soon pls

On 23 Jul 2008, at 12:26, Sujith Gangaraju wrote:

i just want to read the file in browser itself

pls any body reply soon pls

Well to display it in the browser you’re going to have to download it
into the browser, at which point it becomes a JavaScript problem. Have
you considered asking on any of the JavaScript mailing lists whether
an appropriate in-browser renderer exists? Or alternately you could
try the various Rails mailing lists as it’s possible someone else has
run into the same problem.

Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net

raise ArgumentError unless @reality.responds_to? :reason

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jul 23, 2008, at 4:07 PM, Eleanor McHugh wrote:

it will download the file , but i dont want to download the file,

This has nothing to do with JavaScript, but with the disposition
method. By default, files will be delivered as an attachment, what you
want is called “inline”. AFAIK, this can be done via #send_file.
It would be best to ask that question on the Rails mailing list, not
the pure Ruby one.

Regards,
Florian G.


raise ArgumentError unless @reality.responds_to? :reason

Hehe, I like that one.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkiHh4sACgkQJA/zY0IIRZaJvwCgp634HUFZkY6QJ+H7x3q6Fgva
1ggAn3OzjIcQUeYyIRNh4r8x17bGp9/D
=Wj7J
-----END PGP SIGNATURE-----