We need someone to write the VB 6 code to connect to eBay’s File Exchange system and upload CSV files. The connection needs to be secure (we already have a User ID, Password, and Token), and we would prefer someone who has done this sort of coding in the past.
We need straight VB 6 code that we can integrate into our existing application. No public interfaces, no API’s, no EXE’s, no DLL’s, etc. We are NOT using VB.Net at this time, so VB.Net is not an option.
Following is an excerpt from the eBay File Exchange manual on how to do this sort of thing:
Using Programmatic Instructions to Upload Files
To upload your file programmatically, you must send an HTTP post request to eBay File Exchange server to accept the request contents. Perform the following steps:
1. Download and complete the appropriate eBay File Exchange template.
2. Get a security token from eBay File Exchange, described in the next section.
3. Initiate an HTTPS connection and then post your data file with your token to the eBay File Exchange Web address:
https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload
After eBay has processed your data file, you will receive an email that includes a URL to access your Load Results Report.
Sample HTTP Post Request
POST /path/to/upload/script HTTP/1.0
Connection: Keep-Alive
User-Agent: My Client App v1.0
Host: https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUploadForm
Content-type: multipart/form-data boundary=THIS_STRING_SEPARATES
Content-Length: 256
–THIS_STRING_SEPARATES
Content-Disposition: form-data name=?token?
12345678987654321
–THIS_STRING_SEPARATES
Content-Disposition: form-data name=?file? filename=?listings.csv?
Content-Type: text/csv
… contents of listings.csv …
–THIS_STRING_SEPARATES?
eBay File Exchange User Guide 1.5 35
HTTP Post Request Components
Notice that the HTTP Post Request must always include the following components:
? In the first line, the method to be applied to the resource, the identifier of the resource, and the protocol version in use, such as:
POST /path/to/upload/script HTTP/1.0
? The connection, user-agent and host information is next:
Connection: Keep-Alive
User-Agent: My Client App v1.0
Host: https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUploadForm
? Header containing file content and length information:
Content-type: multipart/form-data boundary=THIS_STRING_SEPARATES
Content-Length: 256
? Contents, which includes your security token and then the actual file contents you want to upload:
–THIS_STRING_SEPARATES
Content-Disposition: form-data name=?token?
12345678987654321
–THIS_STRING_SEPARATES
Content-Disposition: form-data name=?file?
filename=?listings.csv?
Content-Type: text/csv
… contents of listings.csv …
–THIS_STRING_SEPARATES–