I migrated my server from TRoIndyHttpServer to TROHttpServer.
One of my routines sends a file from the client to the server.
I receive authenticated PDF files and in the properties of that file comes the warning:
“This file came from another computer and can be blocked to help protect this computer.”
On the TRoIndyHttpServer server, the copy was made to the server without problems. Now for TROHttpServer it does not copy and generates the error: Error sending data.
Below is the code I run for copying.
[ROServiceMethod]
procedure TFaturamento.GetArquivo(sDiretorioArquivos, sNome, sDescricao,
sUsuario: String; Arquivo: Binary; var ID: Integer);
var
qry: TFDQuery;
xNome, xNomeUtilizado, xSQL: String;
xTamanho: Integer;
begin
// verifica se o diretório foi informado, se o mesmo não foi retorna o id como "0"
// para que no Sispetro seja mostrada a mensagegem de que o diretorio não foi
// configurado.
if sDiretorioArquivos = '' then begin
ID := 0;
exit;
end;
xNome := GetNomeArquivo(sNome, sDiretorioArquivos);
xNomeUtilizado:= GetNomeArquivo(sNome, sDiretorioArquivos);
qry := TFDQuery.Create(nil);
try
Arquivo.SaveToFile(sDiretorioArquivos + '\' + xNomeUtilizado);
xTamanho := Arquivo.Size;
Below is an example based on one of your projects.
Please save this project in the C:\RemObjectsCopy folder
On the server side and client side, activate Indy, click on Button1 and select the file C:\RemObjectsCopy\licência fepam.pdf
The server will save a copy of this file in the C:\RemObjectsCopy folder with the name mytest.pdf
Now if you do the same procedure using the server and client with HTTP Server, you will see that an error will be generated and the file will not be copied.
If you take another *.pdf file, the copy will be made.
The problem is these PDFs that Windows has marked as a security flaw.