This shows you the differences between two versions of the page.
public:howto:htmlforms [2007/11/30 09:34] geby created |
public:howto:htmlforms [2012/01/27 11:56] (current) rasc formatting corrected, boundary MUST be separated by semicolon |
||
---|---|---|---|
Line 13: | Line 13: | ||
const | const | ||
FIELD_MASK = CRLF + '--%s' + CRLF + | FIELD_MASK = CRLF + '--%s' + CRLF + | ||
- | 'Content-Disposition: form-data; name="%s"' + CRLF + CRLF | + | 'Content-Disposition: form-data; name="%s"' + CRLF + CRLF+ |
- | + | + | |
'%s'; | '%s'; | ||
begin | begin | ||
Line 21: | Line 20: | ||
try | try | ||
s := '--' + Bound + CRLF; | s := '--' + Bound + CRLF; | ||
- | s := s + 'content-disposition: form-data; name="' + FieldName + | + | s := s + 'content-disposition: form-data; name="' + FieldName + '";'; |
- | '";'; | + | |
s := s + ' filename="' + FileName +'"' + CRLF; | s := s + ' filename="' + FileName +'"' + CRLF; | ||
s := s + 'Content-Type: Application/octet-string' + CRLF + CRLF; | s := s + 'Content-Type: Application/octet-string' + CRLF + CRLF; | ||
Line 36: | Line 34: | ||
s := CRLF + '--' + Bound + '--' + CRLF; | s := CRLF + '--' + Bound + '--' + CRLF; | ||
HTTP.Document.Write(Pointer(s)^, Length(s)); | HTTP.Document.Write(Pointer(s)^, Length(s)); | ||
- | HTTP.MimeType := 'multipart/form-data, boundary=' + Bound; | + | HTTP.MimeType := 'multipart/form-data; boundary=' + Bound; |
Result := HTTP.HTTPMethod('POST', URL); | Result := HTTP.HTTPMethod('POST', URL); | ||
ResultData.LoadFromStream(HTTP.Document); | ResultData.LoadFromStream(HTTP.Document); |