I’m experiencing this same issue. file.Read works fine on the serverside, but if the same exact code is used on clientside it just returns nil. I’ve looked around for solutions for awhile and I’m lost at this point. Any idea what could be causing this?
Edit: Not really sure why im getting marked as late considering no resolution was ever determined for this. It would be pointless to create a new thread for the exact same issue.
I did some extra testing and it seems that the file.Read function is working correctly, but something is happening during the return process. I can modify the file.Read function to print the file content right before return line and it displays the content, however nil is the only value that will get returned by the function for some reason.
For now I am just using the same code that is used in the file.Open function and it works just fine:
local f = file.Open( filename, "rb", path )
if ( !f ) then return end
local str = f:Read( f:Size() )