Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Não faz upload de múltiplos arquivos em Lazarus #236

Open
romerofartura opened this issue Jan 30, 2025 · 1 comment
Open

Não faz upload de múltiplos arquivos em Lazarus #236

romerofartura opened this issue Jan 30, 2025 · 1 comment

Comments

@romerofartura
Copy link

Fiz o ajuste se quiser avaliar.
No arquivo: RESTRequest4Delphi/src/RESTRequest4D.Request.FPHTTPClient.pas
Na procedure TRequestFPHTTPClient.ExecuteRequest(const AMethod: TMethodRequest);
Adicionei as últimas três linhas do bloco abaixo:

  for LFieldName in FFiles.Keys do
        begin
          LFile := FFiles.Items[LFieldName];
          LContent := '--' + LBound + _CRLF;
          LContent := LContent + Format('Content-Disposition: form-data; name="%s"; filename="%s"' + _CRLF, [LFieldName, ExtractFileName(LFile.FFileName)]);
          LContent := LContent + Format('Content-Type: %s', [LFile.FContentType]) + _CRLF + _CRLF;
          LStream.WriteBuffer(LContent[1], Length(LContent));
          LFile.FFileStream.Position := 0;
          LStream.CopyFrom(TMemoryStream(LFile.FFileStream), LFile.FFileStream.Size);
          LStream.WriteBuffer(_CRLF, Length(_CRLF));
        end; 
@viniciussanchez
Copy link
Owner

Bom dia... gostaria de nos enviar um pull request com a implementação?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants