Jump to content

Mocte Sandoval

Members
  • Content Count

    12
  • Joined

  • Last visited

Everything posted by Mocte Sandoval

  1. Mocte Sandoval

    rubicon 4

    As of today I can't answer that question, I suppose it is, it's based on Lucene++, you'll have to find out yourself
  2. Mocte Sandoval

    rubicon 4

    It is not Rubicon but maybe this: https://github.com/IBSurgeon/lucene_udr Can help you with FTS on Firebird I'm not using it, but perhaps I will in the near future
  3. Mocte Sandoval

    MQTT: advice wanted

    Hi @omnibrain I have used Sergio's esegece components in the past I can only say good things about them, the main usage for us was messaging between the core of our software and mobile devices, the software is still running as of today but we are moving our projects from delphi to other technologies. Just to add to the conversation when we did that MQTT project we tried with mosquitto and for us it was never reliable, I can't recall the exact details, but we ended using https://vernemq.com/ it is not available for windows but our server is Linux so no problem, also you can use the open source version without incurring licensing costs as long as you make the build yourself instead of using the prebuilt binaries availables for download, and It's been rock solid to this day . Good luck with your project Regards Mocte
  4. Mocte Sandoval

    XML DOM

    https://github.com/Dennis1000/verysimplexml
  5. Mocte Sandoval

    Indy https server - OAUTH2 implementation?

    May be https://www.esegece.com/delphi/oauth2 Could be of some use for you?
  6. Mocte Sandoval

    POSTing binary data with TIdHTTP

    Hi to all I don't ask here often but now I need some help with Indy ( which I don't use often either btw ). The scenario: I need to upload "documents" ( mostly PDF, Tiff, Jpg ) usually from a file to a third party HTTP server, I am doing that perfectly fine with code like this ( just a snippet ) : var Params: TIdMultipartFormDataStream; Begin ... Params.AddFile(fileName, fullFilePath, 'application/octet-stream'); http.Post('http://x.x.x.x:8996/service', Params, responseStream); ... End The endpoint from the server side receives the file and answers with code 201 which is expected. Now the problem, there are a lot of these "documents" stored on files on disk, each of these files contain a bunch of "documents" on a propietary format, which I'm succesfully extracting as an array of bytes, I can save them as individual files with TFileStream and view them with external tools, but I need to send these individual files to the http server, so for speeding up the process I want to avoid saving them to disk, so what i would like is to send the array of bytes straight to the server, here is an snippet from the code I am using so far: procedure SendFromBytes( const buffer: array of byte ); var ... data, idBoundary: String; ... Begin ... idBoundary := '---someboundaryId'; StreamResp := TStringStream.Create('',TEncoding.UTF8); streamSrc := TMemoryStream.create; http.Request.ContentType := sContentTypeFormData + idBoundary; data := idBoundary + CRLF + 'Content-Disposition: form-data; name="'+name+'"' + CRLF + CRLF; streamSrc.Write(data[1], Length(data)); streamSrc.WriteBuffer(Buffer[0], length(Buffer)); data := CRLF + idBoundary; streamSrc.Write(data[1], Length(data)); http.Post('http://x.x.x.x:8996/service', StreamSrc, streamResp); ... End; But here I'm getting 400 Bad request, so I'm not sending the message as is expected by the server Is there an Indy guru here who can help me find the cause? Edit: I'm on Delphi XE3 Edit 2: spelling on subject
  7. Mocte Sandoval

    POSTing binary data with TIdHTTP

    Good to know, I'll give it a try tomorrow, thank you Remy
  8. Mocte Sandoval

    POSTing binary data with TIdHTTP

    Ok, I got rid of all initial "-" so boundary is now e.g. boundary=4024b236a3a1 on header, --4024b236a3a1 in body, and closing --4024b236a3a1-- And all is working great now ! Thank you so much Attila this was driving me nuts. Edit: How can I mark this topic as resolved?
  9. Mocte Sandoval

    POSTing binary data with TIdHTTP

    Thank you Attila, I stripped that in my search of the correct way, added again with no luck. I'm attaching a sample of what the log looks like, I deleted a great part of its contents because the documents are confidential data but maybe some expert eyes can notice something I'm missing. BTW I think I missed the last line on the log {"error":"multipart: NextPart: EOF"} definitely there is something missing there. test.txt
  10. Mocte Sandoval

    POSTing binary data with TIdHTTP

    Just tested with the same result (400), I didn't show it here but I have a TIdLogFile for logging the message, the data seems to be all in place, I suspect I am constructing the message in some way different from how TIdMultipartFormDataStream is processed by TidHttp and therefore it is possible I'm not sticking to the http spec for a multipart/form-data post but I'm failing to see where.
  11. Hi David, I just stumbled across this thread and saw your video, I remember seeing it sometime ago, at the end there is this link: http://goo.gl/8GRLDk but isn't available anymore, would you mind to share again the code of this sample or any other similar you have available? I would like to play around with it if you don't mind. Thank you.
×