FILE:// URLs not working after upgrading to CEF76

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

FILE:// URLs not working after upgrading to CEF76

Postby joeludwig » Wed Aug 28, 2019 12:14 am

I'm upgrading from 72 to 76, or trying to.

In 72 I could load the contents of a file URL like this:
Code: Select all
   CefRefPtr<CefRequest> request = CefRequest::Create();
   request->SetURL( "file:///c:/some/path/file.foo" );
   request->SetMethod( "GET" );

   CefRefPtr<CefURLRequest> myRequest = CefURLRequest::Create( request, myRequestClient, nullptr );


In 76 I get ERR_UNKNOWN_URL_SCHEME from that request. Is there something special I need to do to keep FILE URLs working in this new version of CEF?


Joe
joeludwig
Newbie
 
Posts: 8
Joined: Wed Aug 28, 2019 12:07 am

Re: FILE:// URLs not working after upgrading to CEF76

Postby magreenblatt » Wed Aug 28, 2019 9:49 am

File URLs are just paths on the local disk. Why not load them using system file functions such as fopen, etc, instead of using CefURLRequest?
magreenblatt
Site Admin
 
Posts: 12404
Joined: Fri May 29, 2009 6:57 pm

Re: FILE:// URLs not working after upgrading to CEF76

Postby joeludwig » Wed Aug 28, 2019 10:00 am

I'm going through CefURLRequest because sometimes the URL will be a file and sometimes it'll use HTTP or HTTPS to fetch something remote. I didn't want to have two dramatically different code paths to handle those two cases.

I could obviously turn the URL into a path and just read the file. If CURLRequest isn't going to support FILE URLs going forward, that's exactly what I'll do. Is that the case?
joeludwig
Newbie
 
Posts: 8
Joined: Wed Aug 28, 2019 12:07 am

Re: FILE:// URLs not working after upgrading to CEF76

Postby magreenblatt » Wed Aug 28, 2019 10:07 am

joeludwig wrote:I could obviously turn the URL into a path and just read the file. If CURLRequest isn't going to support FILE URLs going forward, that's exactly what I'll do. Is that the case?

It is unlikely that FILE URLs will be supported going forward.
magreenblatt
Site Admin
 
Posts: 12404
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 36 guests