Copy selected filenames as URL including UNC?

Hi,

regarding to HOW TO: Copy selected filenames to the clipboard

I've tried to create an URL but including the UNC path and not the drive letter. How could this work?

Some tests:

(Copy full) S:\grafr\ECETRA.txt
=> [file://localhost/S:/grafr/ECETRA.txt](file://localhost/S:/grafr/ECETRA.txt) (after paste into Opera 9.27)
=> file:///S:/grafr/ECETRA.txt (after paste into Firefox 2.0.0.14)
=> S:\grafr\ECETRA.txt (after paste into MS IE 7)
=> file:///S:/grafr/ECETRA.txt (after paste into Safari 3.1.1)

(Copy as UNC) \office.ecetra.com\vie\user\grafr\ECETRA.txt
=> [file://office.ecetra.com/vie/user/grafr/ECETRA.txt](file://office.ecetra.com/vie/user/grafr/ECETRA.txt) (after paste into Opera 9.27)
=> file://///office.ecetra.com/vie/user/grafr/ECETRA.txt (after paste into Firefox 2.0.0.14)
=> \office.ecetra.com\vie\user\grafr\ECETRA.txt (after paste into MS IE 7)
=> office.ecetra.com/vie/user/grafr/ECETRA.txt (after paste into Safari 3.1.1) (completely wrong)

(Copy as URI/URL) file:///S:/grafr/ECETRA.txt
=> [file://localhost/S:/grafr/ECETRA.txt](file://localhost/S:/grafr/ECETRA.txt) (after paste into Opera 9.27)
=> file:///S:/grafr/ECETRA.txt (after paste into Firefox 2.0.0.14)
=> S:\grafr\ECETRA.txt (after paste into MS IE 7)
=> file:///S:/grafr/ECETRA.txt (after paste into Safari 3.1.1)

What I want is this:

[file://office.ecetra.com/vie/user/grafr/ECETRA.txt](file://office.ecetra.com/vie/user/grafr/ECETRA.txt) (after paste into Opera 9.27)

Is it possible with DO 9.1.0.3?

Thanks a lot,
Robert

This seems to do it:

Clipboard COPYNAMES=url,unc

Thanks a lot,

=>

file://///office.ecetra.com/vie/user/grafr/ECETRA.txt

a lot of slashes - as Firefox - but it works

but much better (less slashes) in Opera :wink:

A few fixes could be done in a future DO release. :wink:

Robert

Fixes for what? All of those slashes are needed for UNC file:// URLs to work properly in all programs.

If you see more or fewer slashes after pasting into a particular browser then it's because that browser has parsed the text and decided to display it differently.

[quote="leo"]Fixes for what? All of those slashes are needed for UNC file:// URLs to work properly in all programs.

If you see more or fewer slashes after pasting into a particular browser then it's because that browser has parsed the text and decided to display it differently.[/quote]

I've thought instead of

file://///office.ecetra.com/vie/user/grafr/ECETRA.txt

this

[file://office.ecetra.com/vie/user/grafr/ECETRA.txt](file://office.ecetra.com/vie/user/grafr/ECETRA.txt)

would be much "cleaner" (and DO could do this)

and represents the same URI, or isn't it?

Robert

[quote="fuzi1968"]I've thought instead of

file://///office.ecetra.com/vie/user/grafr/ECETRA.txt

this

[file://office.ecetra.com/vie/user/grafr/ECETRA.txt](file://office.ecetra.com/vie/user/grafr/ECETRA.txt)

would be much "cleaner" (and DO could do this)

and represents the same URI, or isn't it?[/quote]
They're not the same. The second one won't work in Firefox, for example. The first one works in both Firefox and IE. (I didn't try anything else.)

If 'vie' is a network share on office.ecetra.com, they are actually not the same and it should have 4 slashes.

That is, if we can believe Wikipedia on this one

Firefox seems to need 5 slashes and won't work with 4, for whatever reason. Other browsers seem happy with 5 as well, so it seems Opus is right to use 5 slashes (at least in terms of working with as many browsers as possible).

Regarding to the network share:

office.ecetra.com is a domain/host - so multiple slashes before a host or domain are not correct (RFC 3986 - see below):

When I try [file://office.ecetra.com/vie/user/grafr/ECETRA.txt](file://office.ecetra.com/vie/user/grafr/ECETRA.txt) in Firefox 2.0.0.14 - nothing happens (but nothing should only be within http request and not when I paste it into the address field).

Safari 3.1.1 returns "File not found" - but Safari still has problems creating the correct URI's - so I don't want to count this. :wink:

MSIE 7 converts [file://office.ecetra.com/vie/user/grafr/ECETRA.txt](file://office.ecetra.com/vie/user/grafr/ECETRA.txt) AND file://///office.ecetra.com/vie/user/grafr/ECETRA.txt to \office.ecetra.com\VIE\User\grafr\ECETRA.txt and shows the file in both cases - what I expect (for MSIE 7 :wink: ) - and so for me it's right (hahaha) when MS is doing that (removing bad typings by the user).

AND when I look into the RFC 3986, 5 slashes before a domain/host name (office.ecetra.com) is not defined!

When I look into ietf.org/rfc/rfc3986.txt on page # 48, we have

absolute-URI = scheme ":" hier-part [ "?" query ]

hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty

authority = [ userinfo "@" ] host [ ":" port ]

As we know - office.ecetra.com - is the host - and when I check the above logic we have:

[file://office.ecetra.com](file://office.ecetra.com) ... and so on

When I paste file://///office.ecetra.com/vie/user/grafr/ECETRA.txt into Opera, Opera converts it to file:///office.ecetra.com/vie/user/grafr/ECETRA.txt and displays the error:

[quote]
You tried to access the address file:///office.ecetra.com/vie/user/grafr/ECETRA.txt, which is currently unavailable. Please make sure that the Web address (URL) is correctly spelled and punctuated, then try reloading the page.[/quote]

and regarding to the comment:

Opera tries it from localhost and can not find it (which is correct).

So for me - what DO is doing - the 5 slashes are wrong (before a domain name).[/quote]

Please don't start all this RFC stuff up again fuzi :slight_smile:

If you can convince the Firefox developers that needing 5 slashes is wrong and get them to fix Firefox (assuming your interpretation of the RFC is correct), then go for it and then there will be no reason for Opus to use 5 slashes.

Until that happens, there's no point changing Opus in a way which breaks UNC File URLs in Firefox just because you don't like the number of slashes in a clipboard path, especially when other browsers are happy to accept the 5 slash version. Pragmatically, working with everything is always better than not working with a popular tool (i.e. Firefox).