Where you said you wanted to use sendContent_P, I assume you mean ESP8266WebServer::sendContent_P?
If that's right then something like this would be syntactically correct:
Code: Select allFile file = SPIFFS.open(path, "r");
String fileStr = file.readString();
webserver->sendContent_P(fileStr.c_str());
file.close();
But if you wanted this to use as little RAM as possible, then I expect that filling a string like that just to be able to use ESP8266WebServer::sendContent_P probably isn't going to be the best way to go.
Given that in most circumstances you always have to do the file open part (unless you're getting really low level with SPIFFS) then perhaps the easiest most lightweight way to go is to just send the file directly via ESP8266WebServer::streamFile e.g. :
Code: Select allString contentType; //setup the response content type using logic based on the file being sent prior to calling streamFile
File file = SPIFFS.open(path, "r");
webserver->streamFile(file, contentType);
file.close();