Why is my Shopify media upload failing and what is the solution?

Lex26
Tourist
8 0 5

Hey everyone,

I’m trying to upload new products to my store but keep getting ‘media upload failed to process because the image could not be processed’ 

Does anyone know why and how to fix this? It seems to happening to only some of the images, I’ve never had this issue before but need to desperately get new products onto the site.

Please let me know if anyone has a solution! Thanks 

 

Replies 12 (12)

ponch
Visitor
3 0 0

I am having the same issue. Is there any way of debugging the issue?

thetiredealer
Tourist
5 0 3

Did anyone find a fix on this, I'm getting the same issue. Please please help!

masterkey
Visitor
1 0 0

I am also struggling to upload media. Tried all different file types and have had mild success uploading from URL but that's it. 

thetiredealer
Tourist
5 0 3
I had to ask a developer to download the images into a server and upload
them with a different URL link. This is fixed the issue, but it seems
Shopify denies certain URL's or simply the server where you access those
images is denying download

MarziaNaeemi
Visitor
1 0 0

The solution is Just convert the pics to JPG

BeamJokerFavor
Explorer
51 3 6

I am having this problem uploading GLBs to to products using the API. I don't know if it is a problem with my code or with Shopify.

HalAtlanta
Visitor
1 0 2

Did anyone ever get this figured out?

I can't upload the same animated GIF I uploaded a week ago.

Clock-Worth
Visitor
1 0 0


This error shows up when I try to upload pictures below the max permitted Size. PLEASE HELP
File upload failed A processing error occurred. Try again.

BeamJokerFavor
Explorer
51 3 6

Here is my python script for uploading media.

 

 

def form_query(name):
    username = os.getenv("SHOPIFY_ID")
    password = os.getenv("SHOPIFY_PASSWORD")
    glb_path = get_local_glb_path(name)
    filesize = str(os.path.getsize(glb_path))
    headers = {
        'Content-Type': 'application/json',
        'X-Shopify-Access_Token' :  shopify.StorefrontAccessToken.headers['X-Shopify-Access-Token'],
        'X-Upload-Content-Length': filesize,
        'x-upload-content-type': 'application/octet-stream'
    }
    url = form_graphql_url()
    variables = {
        "input" : [
          {
            "filename": "{}.glb".format(name),
            "mimeType": "model/gltf-binary",
            "resource": "MODEL_3D",
            "fileSize": filesize
          }
        ]
    }
    query = '''
    mutation generateStagedUploads($input: [StagedUploadInput!]!) {
  stagedUploadsCreate(input: $input) {
    stagedTargets {
      url
      resourceUrl
      parameters {
        name
        value
      }
    }
  }
}
    '''
    return {
        'query' : query,
        'variables': variables,
        'url': url,
        'headers': headers,
        'filesize': filesize
    }

 

 

Then I call the query.

 

 

def post_graphql(url, query, params, headers):
    r = requests.post(url,json={"query": query, "variables": params},  headers=headers)
    return r

r = post_graphql(get_glb_dict['url'], get_glb_dict['query'], get_glb_dict['variables'], headers2)
print(json.dumps(r.json(), indent=4, sort_keys=True))
  

 

Threaded
Visitor
1 0 0

Hey, it may be late, but i have same issue cant upload image to banner, JPG PNG size it doesnt matter. It shows "1 failed file" i managed to workaround this problem with simple solution which is to upload images to new product and then they go to library. Make new product "test" or whatever, upload pics and hide it. Hope it helps for now 

CatP
Shopify Partner
1 0 1

Not sure if this will help anyone but I fixed this issue by changing the names of the files. I had dots on the name and once I changed it, it worked! Try not to use any special character

Gwen1Indiaverse
Visitor
1 0 0

This really helped! So simple, thank you very much!!!