14

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.

0

2 Answers 2

38

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.

Sign up to request clarification or add additional context in comments.

Comments

8

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

1 Comment

Thanks, I'll try using that now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.