For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

C#.NET code sample to Upload images from local system to EPS using eBayPictureService

  • Answer ID 2196
  • Published 01/27/2017 05:33 AM
  • Updated 01/27/2017 05:33 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=2196
Product
How to upload images to EPS using eBayPictureService in C#

You can use the eBayPictureService class available in the SDK to upload pictures from your local machine to EPS and store the PictureURLs in your local database for future use. Please be aware that you must add an item that uses the uploaded images within five days for Trading API calls and within ten days for Large Merchant Services calls; unassociated pictures are automatically deleted after that period.

Below is a sample AddFixedPriceItem request that lists items in DE site with unit price details showing in the viewItem page.

Sample request for uploading images from local machine

/* 2012-2013 eBay Inc., All Rights Reserved */
/* Licensed under CDDL 1.0 - http://opensource.org/licenses/cddl1.php */

using System;
using System.Collections.Generic;
using System.Text;
using eBay.Service.EPS;
using eBay.Service.Core.Sdk;
using eBay.Service.Core.Soap;

namespace eBayPictureService_Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                ApiContext context = new ApiContext();
                context.ApiCredential.eBayToken = "Your_Token_Here";
                context.Site = SiteCodeType.US;
                context.SignInUrl = @"https://api.sandbox.ebay.com/wsapi";
                eBayPictureService pictureService = new eBayPictureService(context);
                pictureService.ApiContext.EPSServerUrl = @"https://api.sandbox.ebay.com/ws/api.dll";
                string[] pictureList = { @"C:\Users\dsampath\Pictures\New folder\multi-color.jpg", @"C:\Users\dsampath\Pictures\New folder\black-1.jpg", @"C:\Users\dsampath\Pictures\New folder\black-2.jpg", @"C:\Users\dsampath\Pictures\New folder\blue.jpg" };
                string[] picURLs = pictureService.UpLoadPictureFiles(PhotoDisplayCodeType.SuperSize, pictureList);
                Console.WriteLine("EPS Picture URLs:");
                foreach (string pic in picURLs)
                {
                    Console.WriteLine(pic);
                }
                Console.ReadLine();


            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

 

File Attachments

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter