login about faq

I am adding 2 different files to a MIME for a upload over HTTP This is what I have in my code:

Dim http As New ChilkatHttp
Dim req As ChilkatHttpRequest
'  Adding the Connection: Keep-Alive is optional.  It only makes sense if the intent is to send
        '  additional requests to the same domain (your-namespace-sb.accesscontrol.windows.net) within a reasonable time period.
            req.AddHeader "X-EBAY-SOA-SERVICE-NAME", "FileTransferService"
            req.AddHeader "X-EBAY-SOA-OPERATION-NAME", APICALL
            req.AddHeader "X-EBAY-SOA-SECURITY-TOKEN", TokenValue
            req.AddHeader "X-EBAY-API-COMPATIBILITY-LEVEL", "967"
            req.AddHeader "X-EBAY-SOA-REQUEST-DATA-FORMAT", "XML"
            req.AddHeader "X-EBAY-SOA-RESPONSE-DATA-FORMAT", "XML"
        '  --------------------------------------------------
        '  IMPORTANT: Never set the Content-Length header.
        '  Chilkat will automatically compute the correct Content-Length and will add it.
        '  --------------------------------------------------

        '  Add the params to the request.  Given that the Content-Type is set to "multipart/form-data", when
        '  Chilkat composes the request, it will put each param in it's own MIME sub-part (i.e. in it's own
        '  part delimited by the boundary string).
        'req.AddParam "UploadAgent", "InterfaceVersion1.5"
        'req.AddParam "user", "XXX"
        'req.AddParam "password", "XXX"
        'req.AddParam "file", "XXX"
        'req.AddParam "data_version", "XXX"
        'req.AddParam "Content-ID", "<0.urn:uuid:" & XMLUUID & ">"

        Dim pathToFileOnDisk1 As String
        pathToFileOnDisk1 = "C:\Users\Station\Documents\Access XML Save Files\New Testing\uploadFile.xml"
        success = req.AddFileForUpload("uploadFile.xml", pathToFileOnDisk1)
        If (success <> 1) Then
            Debug.Print req.LastErrorText
            Exit Function
        End If

        '  The last param is the contents of a file.
        '  If it's a file on disk, we can add it like this:
        Dim pathToFileOnDisk2 As String
        pathToFileOnDisk2 = "C:\Users\Station\Documents\Access XML Save Files\New Testing\AFPIBulkTest1.gz"
        success = req.AddFileForUpload("AFPIBulkTest1.gz", pathToFileOnDisk2)
        If (success <> 1) Then
            Debug.Print req.LastErrorText
            Exit Function
        End If

This is what I get:

    Content-Disposition: form-data; name="AFPIBulkTest1.gz"; filename="AFPIBulkTest1.gz"
    Content-Type: application/x-gzip

    ‹ÌÝìX AFPIBulkTest1.xml ½Y_oÓ0Gâ;X}@ A“m°uý3`b…²n ñ‚ÜøÚR»Ø,|zÎIÚ´qZHëCeû~wþÙ>Ÿ

But this is what I need:


Content-Disposition: form-data; name="fieldNameHere"; filename="AFPIBulkTest1.gz"
Content-Type: application/x-gzip
Content-Transfer-Encoding: binary
 Content-ID: <urn:uuid:5b23fffc-214d-11e7-93ae-92361f002671>

How do I add the Content-ID Header for the single Attachment? VBA in Access. Thanks

asked Apr 15 at 16:21

Dustin%20Stanley's gravatar image

Dustin Stanley

edited Apr 15 at 16:23

You would call HttpRequest.AddSubHeader(index,"Content-ID","<urn:uuid:5b23fffc-214d-11e7-93ae-92361f002671>"), where the 1st arg is the index of the sub-part (0 would be the index of the 1st MIME sub-part).


answered Apr 15 at 16:26

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Apr 15 at 16:21

Seen: 343 times

Last updated: Apr 15 at 16:26

powered by OSQA