File links in browser

Basically, if i open an txt file in firefox using "File > Open file"
then file is opening perfectly. But if i try to open a txt file from a
file link on a webpage "file:///path" it is not going anywhere?

Can i fix that in ROR ? If i can, then what is the way to get rid of
this ?

? What *exactly* do you mean by "not going anywhere"?

Does the file url exactly match a path and file on your system?

Hassan Schroeder wrote:

Basically, if i open an txt file in firefox using "File > Open file"
then file is opening perfectly. But if i try to open a txt file from a
file link on a webpage "file:///path" it is not going anywhere?

? What *exactly* do you mean by "not going anywhere"?

By this i mean that page is neither reloading nor going to a new tab.
Usually if you click on a link something happens from these two. But now
its not.

Does the file url exactly match a path and file on your system?

Yeah path is exactly the same.

I'm lost. What does this have to do with rails? Sounds like a browser
problem. :-/

Larry

Dunno if it's a bug or a feature, but yeah, file URLs don't seem to work
in FF (or Safari, for that matter). But if the link is hand-crafted (which is
what I tried), I don't see how it could be related to Rails, in any case.

FWIW,

Hassan Schroeder wrote:

Basically, if i open an txt file in firefox using "File > Open file"
then file is opening perfectly. But if i try to open a txt file from a
file link on a webpage "file:///path" it is not going anywhere?

By this i mean that page is neither reloading nor going to a new tab.
Usually if you click on a link something happens from these two. But now
its not.

Dunno if it's a bug or a feature, but yeah, file URLs don't seem to work
in FF (or Safari, for that matter). But if the link is hand-crafted
(which is
what I tried), I don't see how it could be related to Rails, in any
case.

I have a dim memory that this is a feature, designed to prevent remote
websites from tricking you into editing local files or reading them with
JavaScript. But I could be wrong.

FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan

Best,

Marnen Laibow-Koser wrote:

Hassan Schroeder wrote:

Basically, if i open an txt file in firefox using "File > Open file"
then file is opening perfectly. But if i try to open a txt file from a
file link on a webpage "file:///path" it is not going anywhere?

By this i mean that page is neither reloading nor going to a new tab.
Usually if you click on a link something happens from these two. But now
its not.

Dunno if it's a bug or a feature, but yeah, file URLs don't seem to work
in FF (or Safari, for that matter). But if the link is hand-crafted
(which is
what I tried), I don't see how it could be related to Rails, in any
case.

If this is not a feature then how come file opens when a open it with
File > Open file. I think there must be some way in rails as well to
open it. I'll be back to you guys after a bit of R & D.. :slight_smile:

Hassan Schroeder wrote:

I have a dim memory that this is a feature, designed to prevent remote
websites from tricking you into editing local files or reading them with
JavaScript. But I could be wrong.

sounds like http://kb.mozillazine.org/Links_to_local_pages_do_not_work

Fred