This line is right.
$f4view = fopen("$current_dir/$file", "rb");
Assuming that the file exists.
This line is wrong.
$f4view = fread("$current_dir/$f4view",//....
fread() expects the first argument to be a file handle resource (as returned by fopen()), not a filename. Ditto for the fclose().
So what you're doing is opening a file, putting the file handle (Resource #17 as it happens) into $f4view. Then you're (a) trying to use "Resource #17" as a file name in filesize() and fread() (which is why you get the error messages saying that the file "Resource #17" couldn't be found), and (b) even if you got something back, you're trying to put it into $f4view (losing your file handle in the process).
Continued study of the manual pages should answer this. Eg., the first line of the description of fopen says:
resource fopen ( string filename, string mode [, bool use_include_path [, resource zcontext]] )
and that of fread says:
string fread (resource handle, int length )
(Emphasis mine.)
Of course, both lines and the fclose() could be replaced by a single call to [man]file_get_contents[/man].