cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Curl with Xojo (Real Basic) to Upload a File

Hi 

I am writing a Mac desktop app to manage my eBay inventory . I have started coding an upload procedure using CURL to upload a file with a POST into the File Exchange system.

When I run my code I get this response

<html>

<head>

<!--eBay V3- msxml 6.0 XXXXXXXXXXXXXXXXXXXXXXXXXX-->

<!--srcId - File Exchange Programmatically Upload-->

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

<title>Upload File Programmatically</title><script language="JavaScript"><!--

var pageName = "File Exchange Upload";

 

//--></script><script language="javascript" src="http://include.ebaystatic.com/js/e1065/us/legacy/globals_e10651us.js"> </script><script src="http://include.ebaystatic.com/js/e1169/us/legacy/common_functions_e11692us.js"> </script></head>

<body>

File upload successful. Your ref # is .<br><a href="javascript&colon;void(0);" onclick="self.close();return false;">Close</a></body>

</html>

 

 

Which looks promising as it says file upload successful, but when I go to my File Exchange/View Upload results page, there is no file there.

 

Please ca anyone help?

 

Here is my Xojo (RealBasic Code). It uses a commercial Curl library (MonkeyBread Software)

 

dim e as integer
dim d as new UploadCURL
var Token as String
Var FileName as String
Var fi as FolderItem

 

fi = SpecialFolder.UserHome.Child("MMS").Child("Uploads").Child("EBUK").Child("Test16.csv")
FileName = fi.NativePath

 

Token = "My Secret Token"


d.OptionURL = "https://bulksell.ebay.com/ws/ebayISAPI.dll?FileExchangeUpload"
d.OptionVerbose = True
d.CollectOutputData = true

d.FormAddField("token", Token)
d.FormAddField("file", "filename=" + FileName, "text/csv")

d.FormFinish

e=d.Perform


'this bit just displays the results
ListBox1.AddRow "Result: "+str(e)
ListBox1.AddRow d.GetInfoContentType
Result.text = ReplaceLineEndings(d.OutputData,EndOfLine)

 

 

Thanks Mark

Message 1 of 3
latest reply
2 REPLIES 2

Re: Using Curl with Xojo (Real Basic) to Upload a File

I'm not at all familiar with your programming language, but I don't see a ref# in the response file, as if the eBay script failed to run. Was the number missing or did you remove it from the post?

 

Have you manually uploaded a single-record CSV file to File Exchange to verify your CSV data structure is correct? One of the simplest files you can upload is a revision file for a single record with some minor change, like price. I would recommend something that simple when debugging an external program in order to exclude any issues with the file itself.

 

Action,ItemID,StartPrice
Revise,############,12.95

 

Additionally, there may be line-end issues with Mac spreadsheet data, so the CSV should be saved in DOS format. The CSV file should not include any leading BOM characters for UTF-8.

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.
Message 2 of 3
latest reply

Re: Using Curl with Xojo (Real Basic) to Upload a File

@shipscript  is correct. This is a line end issue. Examine 'd.OutputData,EndOfLine' . It should be carriage return,linefeed. Default Mac EndOfLine is just carriage return. eBay expects MS-DOS line endings. Since the language you are using is compiled for Mac, I suspect that the above field is incorrect, and eBay is just throwing out the file that you are uploading (even though the file is uploading successfully).

 

I have used cURL for years to upload files. I get the same response as you do, with the exception that I receive the ref number.

eBay is continually updating this site. Some advice given may have changed. Please reply to this thread, to let us know if this advice works for you. The links on the bottom of any eBay page can help you deal with most eBay issues. Contact eBay Customer Service on Facebook.com/eBay or Twitter.com/AskeBay
Message 3 of 3
latest reply