Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting to Ebay's FileExchange

Status
Not open for further replies.

youthman

Programmer
Apr 28, 2004
49
0
0
US
Hello Guru's!

I am having my own personal nightmare right now! (Isn't everyone that is posting here?) I am hoping you all can help.
I am trying to post to EBay's FileExchange servers so that my wife and I can list things in bulk to our eBay account. This does not seem to be that big of an issue, but I am unable to get this to work! I know my database is good and works fine per eBay's rules as I can post it manually and it works. I believe the issue to be the actual post command and how it processes.
Here is what I have in the code . . .


Perl:
$url="[URL unfurl="true"]https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload";[/URL]

my $ua       = LWP::UserAgent->new();
my $response = $ua->post( $url, { 'token' => $token, 'file' => $thefile } );
my $content  = $response->decoded_content();

When I use this code to post to the site, I receive the following error message back from eBay:

This link is applicable only for programmatically upload. Otherwise the token you have entered may be wrong, please verify and upload again.

I have verified the Token, and it is correct.

The eBay documentation does not help much, but here is what it says about this . . .
Uploading files programmatically
To upload your file programmatically, send an HTTP Post request to the File Exchange server to accept the request:
1. Download and complete the appropriate File Exchange template.
2. Initiate an HTTPS connection and then post your data file with your token to the File Exchange URL: Tip: See Sample HTTP Post Request on page 50.
To indicate your data is processed, eBay sends an email message that includes the URL at which to access the Load Results report.

Here is the sample HTTP Post Request:
Sample HTTP Post Request
POST /path/to/upload/script HTTP/1.0
Connection: Keep-Alive
User-Agent: My Client App v1.0
Host:
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_SEPARATESHTTP

Post Request Components
The HTTP Post request must 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:
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: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

I APPRECIATE YOUR SPEEDY RESPONSE AND HELP!

Thank you in advance,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top