Em: ACBrNFSeXWebserviceBase
function TACBrNFSeXWebservice.GravarJSON(NomeArquivo, ConteudoXML: String;
const aPath: String): Boolean;
var
SoNome, SoPath: String;
begin
Result := False;
try
SoNome := ExtractFileName(NomeArquivo);
if EstaVazio(SoNome) then
raise EACBrDFeException.Create('Nome de arquivo não informado');
SoPath := ExtractFilePath(NomeArquivo);
if EstaVazio(SoPath) then
SoPath := aPath;
if EstaVazio(SoPath) then
SoPath := FPConfiguracoes.Arquivos.PathSalvar;
SoPath := PathWithDelim(SoPath);
ConteudoXML := StringReplace(ConteudoXML, '<-><->', '', [rfReplaceAll]);
if not DirectoryExists(SoPath) then
ForceDirectories(SoPath);
NomeArquivo := SoPath + SoNome;
WriteToTXT(NomeArquivo, ConteudoXML, False, False);
Result := True;
except
on E: Exception do
GerarException('Erro ao salvar.', E);
end;
end;
Aqui é que ele atlera. No ExtratFilePath('20251128085256-con-nfse-chv-soap.json') vai retornar vazio aí ele usa: SoPath := FPConfiguracoes.Arquivos.PathSalvar;
Até aí tudo bem, para salvar os arquivos. Mas ele mantém esse, e não respeita o Path do PDF