Hi,
sorry but I have some problems with the suggestions indicated above ...
if the file to be decoded is "simple" ... to the work ....
if instead there are special characters it does NOT work ...
as an attachment it is possible to view the generated file (correct.xml.p7m) and instead the one generated by my delphi code (NotCorrected.xml.p7m)
the code
...............................................
strtofile is e simple procedure:
thanks
Alessandro Romano
sorry but I have some problems with the suggestions indicated above ...
if the file to be decoded is "simple" ... to the work ....
if instead there are special characters it does NOT work ...
as an attachment it is possible to view the generated file (correct.xml.p7m) and instead the one generated by my delphi code (NotCorrected.xml.p7m)
the code
...............................................
Code:
var
sfile : AnsiString;
Base64 : AnsiString;
IDBytes : TIdBytes;
begin
...
lHTTP := TIdHTTP.Create;
//sfile string in precedent post (coded64)
IDBytes := TIdDecoderMIME.DecodeBytes(sfile);
Base64 := BytesToString(IDBytes, IndyTextEncoding_UTF8);
StrToFile('c:\temp\NotCorrect.xml.p7m', Base64);
...strtofile is e simple procedure:
Code:
procedure StrToFile(const FileName, SourceString: AnsiString);
var
Stream : TFileStream;
begin
Stream:= TFileStream.Create(FileName, fmCreate);
try
Stream.WriteBuffer(Pointer(SourceString)^, Length(SourceString));
finally
Stream.Free;
end;
end;thanks
Alessandro Romano

