Find the answer to your question
Advanced Search Product -Select Product- Trading API Shopping API Merchandising API Large Merchant Services Client Alerts API Feedback API Open eBay Apps Finding API Product Services Sandbox Others MIP Media API Notification API Identity API Charity API Taxonomy API Catalog API Recommendation API Compliance API Logistics API Finances API(Alpha) Negotiation API Listing API Sell Feed API Marketing Ads API Account API Inventory API Fulfillment API Marketing Promotion API Analytics API Metadata API Offer API Marketplace Insights API Deal API Marketing API Feed API Browse API Order API Analytics API Cancellation API Case Management API Inquiry API Return API
Category -Select- Getting Started Sample Code Troubleshooting HowTo's / Best Practices No Value
Language -Select- C# Flex Java JavaScript PHP VB.NET VB6
Format -Select- All XML SOAP JSON Name Value N/A
SDK -Select- .NET Java JavaScript Flax/Flash Mobile - iOS None
Sort by Default Summary New Description Date Updated
Sort order Descending Ascending
Search
Published: March 14 2012, 12:18:00 PM Updated: November 28 2020, 10:21:33 PM
I am trying to call Upload File with a valid TaskRefeenceId and FileReferenceId, But the server throws an error saying "Invalid File Attachment". I checked my attachment , and the attachment I am sending to eBay is valid. What am i missing here?
The Error "Invalid File Attachment" is returned not just when you upload an invalid/null attachment, but also when the UUID of the Attachment in the uploadFileRequest doesn't match with the UUID sent along with the attachment.
Take this example; I will be printing the actual request sent to clearly distinguish the error.
My request that throws an error is as below:
Incorrect Request
POST /lms/echo.php HTTP/1.1
Host: localhost:8082
Accept: */*
X-Ebay-Soa-Request-Data-Format: XML
X-Ebay-Soa-Response-Data-Format: XML
X-Ebay-Soa-Security-Token: Your-Token
X-Ebay-Soa-Operation-Name: uploadFile
X-Ebay-Soa-Service-Name: FileTransferService
Content-Length: 27228
Expect: 100-continue
------------------------------e4b5e1ac668d
Content-Disposition: form-data; name="uploadFileRequest.xml"; filename="C:/xampp/htdocs/lms/application/UploadFile/uploadFileRequest.xml"
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:4A515E9048570>
<uploadFileRequest xmlns:sct="http://www.ebay.com/soaframework/common/types" xmlns="http://www.ebay.com/marketplace/services"><taskReferenceId>50002268550</taskReferenceId><fileReferenceId>50002404690</fileReferenceId><fileFormat>gzip</fileFormat><fileAttachment><Size>1235121</Size><Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid: urn:uuid:4A51606E0C0D1 " /></Data></fileAttachment></uploadFileRequest>
------------------------------e4b5e1ac668d
Content-Disposition: form-data; name="BulkDataExchangeRequest.xml"; filename="C:/xampp/htdocs/lms/application/UploadFile/AddFixedPriceItemExample.gz"
Content-Type: application/octet-stream;
Content-Transfer-Encoding: binary
Content-ID: <1.urn:uuid:4A51606E0C0D1>
This will throw an error because the UUID for the attachment does not match with the attachment's Content-ID you sent. Please find the UUID in red, and note that cid: is not a part of UUID.
The correct request should be
Correct Request
------------------------------e4b5e1ac668d
Content-Disposition: form-data; name="uploadFileRequest.xml"; filename="C:/xampp/htdocs/lms/application/UploadFile/uploadFileRequest.xml"
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:4A515E9048570>
<uploadFileRequest xmlns:sct="http://www.ebay.com/soaframework/common/types" xmlns="http://www.ebay.com/marketplace/services"><taskReferenceId>50002268550</taskReferenceId><fileReferenceId>50002404690</fileReferenceId><fileFormat>gzip</fileFormat><fileAttachment><Size>1235121</Size><Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href=" cid: urn:uuid:4A51606E0C0D1 " /></Data></fileAttachment></uploadFileRequest>
------------------------------e4b5e1ac668d
Content-Disposition: form-data; name="BulkDataExchangeRequest.xml"; filename="C:/xampp/htdocs/lms/application/UploadFile/AddFixedPriceItemExample.gz"
Content-Type: application/octet-stream;
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:4A51606E0C0D1>
This is important because, Most of the times users build the requests programmatically.
Note: Please note that this applies to the request's UUID as well. If the Request's UUID doesn't match with the request's content ID , the UploadFileRequest will not go through at all.
How well did this answer your question? Answers others found helpful