Small company logo:
   History
 
Advertising banner:
 
 HTTP.SendAttachment
Home • Help • Customization Tools • FCAS • Language Reference • HTTP.SendAttachment
 
Purpose
Encodes an attachment to a request to be sent to the remote server.
Syntax
HTTP.SendAttachment [(Index)] = "ObjectType"


Index
The integer index that identifies the attachment, in the case of multiple attachments.
ObjectType
Specifies the object type of the attachment. Attachments can be files, server files, string variables, or binary variables.

Example
Dim WebService as HTTP
Dim f as File

f.OpenFile("test.jpg")

WebService.SendBody = "Hello World"
WebService.Timeout = 5
WebService.SendContentType = "application/octet-stream"
WebService.UseChunking = FALSE
WebService.SendHeader("X-SPECIAL","Orangutan")
WebService.SendAttachFilename = "test.jpg"
WebService.SendAttachContentType = "application/octet-stream"
WebService.SendAttachMIMEType = "image/jpeg"
WebService.SendAttachment = f
WebService.Post("127.0.0.1")
Debug "Return code from HTTP server is " & WebService.Error
Debug "Reply is:" & fcCR & WebService.ReplyBody
Debug "X-SPECIAL header is " & WebService.ReplyHeader("X-SPECIAL")
Debug "Attachment content ID separator is " & WebService.ReplyAttachContentID
Debug "Attachment length is " & Len(WebService.ReplyAttachment)