curl / Mailing Lists / curl-library / Single Mail


Re: Any way to make file:// urls use a relative path?

From: Daniel Stenberg <>
Date: Mon, 19 Mar 2018 00:32:34 +0100 (CET)

On Sun, 18 Mar 2018, Tetetest wrote:

> In libcurl 7.48.0, I could read a file from current working directory by
> using "file://filename.ext" URL. After upgrading to 7.59.0, this is no
> longer possible:

Relative paths are not possible with file://. It may have been possible
before, (more or less by accident) but over recent years we've worked on
making sure curl A) acts more similar to browsers on the same input and B)
doesn't trick users into getting something they didn't expect.

You can still get something based on the current directory by inserting it
yourself into the URL, like reading README from current directory:

   curl file://`pwd`/README

Received on 2018-03-19