asked on
Content-Type: multipart/mixed;
boundary="------------080707010302060306060800";
This is a multi-part message in MIME format.
--------------080707010302060306060800
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
This is the plain-text body.
--------------080707010302060306060800
Content-Disposition: attachment; filename="starfish.gif";
Content-Transfer-Encoding: base64
Content-Type: image/gif; name="starfish.gif";
R0lGODlhIAAgAPcAAP///+/v7/f39+/n5/fv7//39/fn597OzufW1tbGxs69vffe3u/W1salpZQQ
EIQYEJwQCJQYCJwYCM6clL2Ee5wpGIwhEK0YANatpdalnHMYCKUhCJQYAKUYAM6Ec5QhCJwhCPfW
zu/Oxta1rb17a6UhAK0hAPe9rb2Ec7V7a71rUpwpCL0xCJwhAOfOxta9tcatpdallM6cjMaUhK1C
IZwxELU5EK0xCLUxCN61pcacjK1rUrVaOaVKKZxCIZwxCKUxCL05CLUxAM6llO+1nMZzUr1rSrVS
KaVCGK1CGLVCEJQxCK05CLU5CIwpAKUxAK0xAM69tffWxrVrSrVaMbVKGMZKEL1CCLU5AP/v597O
xufGtcallNaljLWEa96ce9aUc717Wq1aMcZjMbVaKbVSIa1KGL1SGJw5CK1CCLVCCMZKCM5KCMZC
APfn3tbGvc57Ss5aGMZSENZaEL1KCM5SCLVCAMZKAPfezvfOte/GrdatlN6cc9aEUr1rOc5jIdZj
GL1SEM5aELVKCMZSCNZaCL1KAOfOvc57Qs5jGNZjEM5aCMZSAN5aAO/OtefGrcZjGM5jEN5rELVS
CMZaCN5jCOdrCM5aAO/Gpc5rGMZjENZrEN5jAOdrAOfe1t6MQtZ7Kd57IdZzGM5rEMZjCNZrCM5j
ANbOxu/Wve+9jPe9hO+1e+etc85zGO+EGMZrENZzEM5rCN5zCO97COdzAO/n3u+1c+ecSt6UQs57
Ie+MIdZ7GOeEGM5zEO+EELVjCOd7CO+ECOd7AO/Ope+tWuelUu+UKeeMGOeEEO+MEOeECO+EAO/G
jO+cKfeUEO+MCO+tSuecMeeUGN6MEOeMCO+UCO+tQuelOe+lMe+lKe+cGOeUEO+cEOeUCN6MAO+U
AOe9c/e1Oe+lId6UEO+cCPe9Qve1Me+lEOecCO+lCOe1Su+1OeelGO+tGPetCPetAO+9Qve1GO+1
EPe9CPe9APf37+fv5/f//+/v9/fv9+fe5+/e5869xufW3t7GzgAAACwAAAAAIAAgAAAI/wABCBxI
sKDBgwgTFgCwMKHDhwyHYWoIsWIBZsdyHaoIcaGbaNQ0ZeBYEROvV0pmCCDp8B4rZaOUcGHpcIEx
aqPMYLjHMcsCAwgxkRv3q8wLnhAdfWpmDRwqAgQFEEvHLlCZNxwfpVmkDJ04dczc3LsXQtq4XWh8
aGH48F49FDUC9UInT941W6luCUOWyQmSLST3eUnChNS4c9SooQuGDNkrIIrA1MqXr0A+AyFC4Kln
kMAQKljotJJGDZklS9PkyEHGLZu1ctbCmWvXThurfAbvHSii5kegxpYqtRpEKFnid/TSneu2LRYh
P/0Q1tJRgYOZV71UL5LEK1KiV68yVf+xgaOKmAZICd5bmA8FEyZQlMjRRAhQGQv4QQSJL8ZLFHwP
6aFIJXNIEkggcgQhwYIlKEFFGDKcEgBCBVCkByC0IAMJGnSAYsUNEmzAgw4HBJBeQisZcAswjqGh
wQeBKGIFFD0ocCJE9diyjTKRLPHBAx/cEAcdgxgx4Vg3HnSPKs4E00sNEYDwgQksQDLJIohMSJIj
ugSTCRA/ILFDCjTckUkrpYiCAEluYCMLJCsoMQUM9gjQRSSL7CLJJjmQxMw3kQChxA78IFULHIK0
MgonXyR5UAHWVBKIEmEcUJAIYxgSSSF94AZRPrgsQgUF0RmUgWpy/LFmRYdMkACAANwrWA8cbAhi
RZ8cjRWro0QEEsQVGTiKkLAM5QNGFWrAQFNLBIzABQPLRktQQAA7
--------------080707010302060306060800--
Dim mime As New ChilkatMime
Dim success As Long
success = mime.UnlockComponent("Anything for 30-day trial.")
If (success = 0) Then
Text1.Text = Text1.Text & mime.LastErrorText & vbCrLf
Exit Sub
End If
' Load the sampleMime2.txt file into the MIME object.
' (This file is available at http://www.chilkatsoft.com/testData/sampleMime2.txt )
success = mime.LoadMimeFile("sampleMime2.txt")
If (success = 0) Then
Text1.Text = Text1.Text & mime.LastErrorText & vbCrLf
Exit Sub
End If
' The GIF image is the 2nd sub-part located directly under the
' top-level MIME node. Indexing begins at 0, therefore the 2nd
' sub-part is at index 1.
Dim part2 As ChilkatMime
Set part2 = mime.GetPart(1)
Dim binaryData() As Byte
' The GetBodyBinary method returns the binary bytes
' of the part's body, automatically decoded from whatever
' content-transfer-encoding might be used (such as base64).
binaryData = part2.GetBodyBinary()
' We now have the binary bytes of the GIF image in binaryData.
' Save it to a file.
Dim fac As New CkFileAccess
success = fac.WriteEntireFile("out1.gif",binaryData)
If (success <> 1) Then
Text1.Text = Text1.Text & fac.LastErrorText & vbCrLf
Exit Sub
End If
' An easier way to save the body content to a file,
' assuming your application does not need to access
' the binary data in-memory, is to call SaveBody
success = part2.SaveBody("out2.gif")
If (success = 0) Then
Text1.Text = Text1.Text & part2.LastErrorText & vbCrLf
Exit Sub
End If
Text1.Text = Text1.Text & "Finished." & vbCrLf
Public Function EbayDownloadFile()
Dim reader As New MSXML2.XMLHTTP40
Dim Doc As New MSXML2.DOMDocument
Dim TokenValue As String
Dim APICALL As String
Dim DevName As String
Dim AppName As String
Dim CertName As String
On Error GoTo ErrorHandler1
TokenValue = Forms!frmEbayTokenCode!txtTokenCode ' This is used for the Token Code insert manually on the Form Ebay Add Fixed Price Item.
DevName = Forms!frmEbayTokenCode!txtDevName 'Supplied by ebay.
AppName = Forms!frmEbayTokenCode!txtAppName 'Supplied by ebay.
CertName = Forms!frmEbayTokenCode!txtCertName 'Supplied by ebay.
APICALL = "downloadFile"
Doc.Load "C:\Users\Station\Documents\Access XML Save Files\New Testing\downloadFile.xml" 'Document Location of the XML File With Items Being Added
reader.Open "POST", "https://storage.sandbox.ebay.com/FileTransferService", False
reader.setRequestHeader "X-EBAY-SOA-OPERATION-NAME", APICALL
reader.setRequestHeader "X-EBAY-SOA-SECURITY-TOKEN", TokenValue
reader.setRequestHeader "X-EBAY-API-DETAIL-LEVEL", "0"
reader.setRequestHeader "X-EBAY-API-COMPATIBILITY-LEVEL", "967"
reader.setRequestHeader "X-EBAY-API-SITEID", "0"
reader.setRequestHeader "X-EBAY-API-DEV-NAME", DevName
reader.setRequestHeader "X-EBAY-API-APP-NAME", AppName
reader.setRequestHeader "X-EBAY-API-CERT-NAME", CertName
reader.send Doc 'This sends the XML document from above.
Do Until reader.ReadyState = 4
DoEvents
Loop
'Get the server's response
sResponse = reader.responseText
SaveStringAsTextFile "C:\Users\Station\Documents\Access XML Save Files\New Testing\ebay_StartJobRequest_response_File.txt", sResponse
'**********************************************************************************************************************************************************
'ChilKat Code Start
'**********************************************************************************************************************************************************
Dim mime As New ChilkatMime
Dim success As Long
success = mime.UnlockComponent("Anything for 30-day trial.")
If (success = 0) Then
reader.responseText = reader.responseText & mime.LastErrorText & vbCrLf
Exit Function
End If
' Load the sampleMime2.txt file into the MIME object.
' (This file is available at http://www.chilkatsoft.com/testData/sampleMime2.txt )
success = mime.LoadMimeFile("C:\Users\Station\Documents\Access XML Save Files\New Testing\ebay_StartJobRequest_response_File.txt")
If (success = 0) Then
reader.responseText = reader.responseText & mime.LastErrorText & vbCrLf
Exit Function
End If
' The GIF image is the 2nd sub-part located directly under the
' top-level MIME node. Indexing begins at 0, therefore the 2nd
' sub-part is at index 1.
Dim part2 As ChilkatMime
Set part2 = mime.GetPart(1)
Dim binaryData() As Byte
' The GetBodyBinary method returns the binary bytes
' of the part's body, automatically decoded from whatever
' content-transfer-encoding might be used (such as base64).
binaryData = part2.GetBodyBinary()
' We now have the binary bytes of the GIF image in binaryData.
' Save it to a file.
Dim fac As New CkFileAccess
success = fac.WriteEntireFile("C:\Users\Station\Documents\Access XML Save Files\New Testing\ChilKat1.gz", binaryData)
If (success <> 1) Then
reader.responseText = reader.responseText & fac.LastErrorText & vbCrLf
Exit Function
End If
' An easier way to save the body content to a file,
' assuming your application does not need to access
' the binary data in-memory, is to call SaveBody
success = part2.SaveBody("C:\Users\Station\Documents\Access XML Save Files\New Testing\ChilKat2.gz")
If (success = 0) Then
reader.responseText = reader.responseText & part2.LastErrorText & vbCrLf
Exit Function
End If
reader.responseText = reader.responseText & "Finished." & vbCrLf
Exit Function
ErrorHandler1:
MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & _
VBE.ActiveCodePane.CodeModule, vbOKOnly, "ErrorHandler1"
Set reader = Nothing
End Function
Public Sub SaveStringAsTextFile(psPathFile As String, psFileContents)
'160730 strive4peace
Dim iFile As Integer
On Error GoTo ErrorHandler4
iFile = FreeFile
Open psPathFile For Output As iFile
Print #iFile, psFileContents
Close iFile
Exit Sub
ErrorHandler4:
MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & _
VBE.ActiveCodePane.CodeModule, vbOKOnly, "ErrorHandler4"
Set reader = Nothing
Set strmImage = Nothing
Set objNode = Nothing
Set objXML = Nothing
End Sub
ASKER
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
ASKER
So how would I use it for (I believe this is the correct way to say it) content that is in memory?
Thanks.