[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

read document in browser itself

Sujith Gangaraju

7/23/2008 11:27:00 AM



Thorsten Mueller 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
--
Posted via http://www.ruby-....

2 Answers

Eleanor McHugh

7/23/2008 2:08:00 PM

0

On 23 Jul 2008, at 12:26, Sujith Gangaraju wrote:
> Thorsten Mueller 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

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-...
----
raise ArgumentError unless @reality.responds_to? :reason



Florian Gilcher

7/23/2008 7:28:00 PM

0

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


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

> On 23 Jul 2008, at 12:26, Sujith Gangaraju wrote:
>> Thorsten Mueller 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
>
> 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.
>

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 Gilcher

> ----
> 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-----