mormot取multipart分界符

mormot取multipart分界符

function getBoundary(const inContentType: RawUTF8): RawUTF8; //multipart 分界符
var boundary: RawUTF8;
    i,j: integer;
    P: PUTF8Char;
    part: TMultiPart;
begin
  Result := '';
  i := PosEx('boundary=',inContentType);
  if i=0 then
    exit;
  TrimCopy(inContentType,i+9,200,boundary);
  if (boundary<>'') and (boundary[1]='"') then
    boundary := copy(boundary,2,length(boundary)-2); // "boundary" -> boundary
  Result := boundary;
end;

  

posted @ 2021-01-19 09:53  delphi中间件  阅读(364)  评论(0编辑  收藏  举报