13

What's the protocol for local files using URL? I've downloaded a file using Java and I need to know how to access it, not using File, but using URL.

Grzegorz Żur
  • 47,257
  • 14
  • 109
  • 105
Ziddia
  • 367
  • 2
  • 4
  • 9

2 Answers2

37

Unix

file://localhost/<path>
file:///<path>

Windows

file://localhost/<drive>|/<path>
file:///<drive>|/<path>
file://localhost/<drive>:/<path>
file:///<drive>:/<path>

For more information see the related Wikipedia article.

Kohányi Róbert
  • 9,791
  • 4
  • 52
  • 81
8

You may use file:/// and file path. For e.g. file:///c:/temp.txt

jatanp
  • 3,982
  • 4
  • 40
  • 46