Instead of mFileURL = nsCString( "file://" ); mFileURL.Append( output[ 0 ] ); it should look like this (untested): nsCOMPtr<nsIFile> localfile; nsresult rv = NS_NewNativeLocalFile( output[ 0 ], PR_FALSE, getter_AddRefs(localfile)); if (NS_FAILED(rv)) return v; rv = net_GetURLSpecFromActualFile(localfile, mFileURL); if (NS_FAILED(rv)) return v;