/* When the stream is complete, the browser calls NPP_StreamAsFile to provide the instance with a full path name for a local file for the stream. NPP_StreamAsFile is called for streams whose mode is set to NP_ASFILEONLY or NP_ASFILE only in a previous call to NPP_NewStream. If an error occurs while retrieving the data or writing the file, the file name (fname) is null. */ void NpapiPlugin::StreamAsFile(NPStream* stream, const char* fname) { NpapiStream* s = static_cast<NpapiStream*>( stream->pdata ); // check for streams we did not request or create if ( !s ) return; std::string cacheFilename( fname ); s->signalCacheFilename( std::wstring( cacheFilename.begin(), cacheFilename.end() ) ); }