How to create Url object from public file URI?

  • Open
  • shahnawazmalik
    Keymaster
    December 3, 2019 at 6:06 am #4356

    How can a Url object be created from a file URI? Using the URI for a public file as a parameter for Url::fromUri() gives the error:

    “UnexpectedValueException: External URLs do not have internal route parameters. in Drupal\Core\Url->getRouteParameters()”.