delphi - TWebResponse is not parsing my posted files -


I have a simple datasnap REST server, on TWebModule, I wrote a post request "upload / document" on the path. On the Action Event I have this code:

  Process TWebModule.WebModulePostFileAction (Sender: Tubect; ​​Request: Twib Request; Response: Twib Response; var Handleld: Boolean); Var i: integer; Str: string; I: Start for: 0 to request.Files. Start Count 1: Str: = Str + ',' + Request. Files Item [i] .FileName; // I would like to save or transfer the uploaded file like c: \ myFiles \ End; reaction. Content: = Str; End;   

Request.Files.Count is always 0, but when I inspect Request.content object, I can see multipart file content. How can I get the posted file from the request? And in the disc where there is something left.
My HTML form from which I look like a posting:

  & lt; Form action = "/ upload_file" method = "POST" enctype = "multipartile / form-data" & gt; Note: & lt; Input type = "text" name = "notes" /> File: & lt; Input type = "file" name = "my_file" /> & Lt; Input type = "submit" value = "submit" & gt; & Lt; / Form & gt;   

Unfortunately there is no information about this subject, I am trying many things for hours, but not success. thank you in advanced.

See related questions and answers:

TIdHTTpserver is currently multipart / Form-data does not support submissions, it is on the Tudo list for the Indy 11. In the meantime, you must manually parse the posted MIME data using TIdDecoderMIME, as mjn has suggested. Before Embarcadero and Indy are the examples posted in the forum.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -