Another random guess, maybe you should check the HTTP header/response/type of content...etc Maybe httpstatus.io or anything similar can help or...
I can only random guess about the issue, - is it file permission stopping the code to open it? - file is not empty, right? As the error is open...
Separate names with a comma.