java - Jet.Com Bulk Upload error -


i integrating jet.com our java based application.i able upload merchant sku bulk upload file,but in partner dashboard gives error "file not found".

java api code:

      try {               string url = fileurl.get("url").tostring().trim();           string gzipfile = filepath + ".gz";           fileinputstream fis = new fileinputstream(file);         fileoutputstream fos = new fileoutputstream(gzipfile);         gzipoutputstream gzipos = new gzipoutputstream(fos);         byte[] buffer = new byte[1024];         int len;         while((len=fis.read(buffer)) != -1){             gzipos.write(buffer, 0, len);         }         //close resources         gzipos.close();         fos.close();         fis.close();            httpput request = new httpput(url);           request.addheader("x-ms-blob-type", "blockblob");            fileentity  entity = new fileentity(new file(gzipfile));           entity.setcontenttype(contenttype.application_octet_stream.tostring());           entity.setcontentencoding("gzip");           request.setentity(entity);            httpresponse res = httpclient.execute(request);           system.out.println(entityutils.tostring(res.getentity()));           return true;     } 

while viewing uploaded file in jet.com partner portal,it gives error "file not found". guess problem might httpput file upload code, not sure.

enter image description here

{"sl-sbec-32l":{"product_title":"foldable fabric drawer lagoon blue","product_description":"brighten home lagoon blue foldable fabric drawer tidy living. bright blue drawer offers convenient way organize , sort small items cords, keys, cooking utensils , more. cube-style drawers perfect use cube organizers, open shelving units , more. fabric drawers feature open top easy access , versatility. built-in fabric handle on front makes drawer easy grip , easy operate. foldable fabric drawers tidy living great addition home’s decor , can used seasonal update. medium cube organizers measure 10.5” w x 10.5” d x 11” h , perfect size uses. other colors of fabric drawers available including black, red, , brown.","brand":"tidy living","standard_product_codes":[{"standard_product_code":"849392007293","standard_product_code_type":"upc"}],"mfr_part_number":"sl-sbec-32l","jet_browse_node_id":13000263,"multipack_quantity":1,"main_image_url":"https:\/\/tidyliving.com\/pub\/media\/catalog\/product\/s\/l\/sl-sbec-32l_-_non-woven_fabric_foldable_fabric_drawer_-_blue_-_angle.jpg","alternate_images":[{"image_slot_id":1,"image_url":"https:\/\/tidyliving.com\/pub\/media\/catalog\/product\/s\/l\/sl-sbec-32l_-_non-woven_fabric_foldable_fabric_drawer_-_blue_-_sideways.jpg"},{"image_slot_id":2,"image_url":"https:\/\/tidyliving.com\/pub\/media\/catalog\/product\/s\/l\/sl-sbec-32l_-_non-woven_fabric_foldable_fabric_drawer_-_blue_-_front.jpg"}]}}

this json file, file needs in .json.gz format.

  1. please check json.gz format correct or not.
  2. after upload url "get url request.
  3. increase expiry time(in sec) if needed".
  4. check json.gz contain proper merchantsku json file. 5.check put request headers contain x-ms-blob-type :blockblob.

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -