Error in uploading staged video using Graphql

Error in uploading staged video using Graphql

Tina86
Shopify Partner
4 1 1

I am trying to upload video to shopify using Graphql API.

I can successfully Generate the upload URL and parameters for video just as an example in the link.

But when I try to upload the video using the url and parameter, I am getting an error

Error uploading product video file to: https://shopify-video-production-core-originals.s3.amazonaws.com/

javax.net.ssl.SSLException: Broken pipe (Write failed).

 

 

mutation {
	stagedUploadsCreate(input: {fileSize:"18383897",filename:"DS442d5ee6-d5c2-4d94-bd55-17f696cfa996.mp4",httpMethod:POST,mimeType:"video/mp4",resource:VIDEO}) {
    stagedTargets {
	parameters {
		name
		value
	}
	resourceUrl
	url
}
    userErrors {
	message
	field
}
  }	
}


Response :
{"data":{"stagedUploadsCreate":{"stagedTargets":[{"parameters":[{"name":"bucket","value":"shopify-video-production-core-originals"},{"name":"key","value":"c\/o\/v\/9f9b31099999999991372053599370.mp4"},{"name":"policy","value":"eyJjb25kaXRpb25zIjpbWyJlcSIsIiRidWNrZXQiLCJzaG9waWZ5LXZpZGVvLXLTEvczMvYXdzNF9yZXF1ZXN0Il0sWyJlcSIsIiR4LWFtei1hbGdvcml0aG0iLCJBV1M0LUhNQUMtU0hBMjU2Il0sWyJlcSIsIiR4LWFtei1kYXRlIiwiMjAyMjAxMDVUMjIyNzIzWiJdXSwiZXhwaXJhdGlvbiI6IjIwMjItMDEtMDVUMjM6Mjc6MjNaIn0="},{"name":"cache-control","value":"public, max-age=31536000"},{"name":"x-amz-signature","value":"4d688dc53204401e185927708fa"},{"name":"x-amz-credential","value":"AKIAYOI563LU\/20220105\/us-east-1\/s3\/aws4_request"},{"name":"x-amz-algorithm","value":"AWS4-HMAC-SHA256"},{"name":"x-amz-date","value":"202201052723Z"}],"resourceUrl":"https:\/\/shopify-video-production-core-originals.s3.amazonaws.com?external_video_id=4843237","url":"https:\/\/shopify-video-production-core-originals.s3.amazonaws.com\/"}],"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":11,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":989,"restoreRate":50.0}}}}

 

I am using Java to generate post request and MultipartEntityBuilder for uploading the video .

Thanks for any help and suggestions!

 

Replies 2 (2)

Himanshu114
Shopify Partner
2 0 0

Is this issue resolved?

Himanshu114
Shopify Partner
2 0 0

Got this working by using 

map.add("file", new FileSystemResource("Video location"));