Stripping '?v=...' from image URLs

I’m exporting images from bubble to Instagram and I’ve noticed some images have content in the URL which makes the upload to Instagram fail.

For example:

This works: https://2b38a319ca4d80724496d675e3d5201d.cdn.bubble.io/f1751864064463x345115714313077840/JM-1009-39_30.jpg

This fails: https://2b38a319ca4d80724496d675e3d5201d.cdn.bubble.io/f1755741232317x661348103940845700/111484_5_a63e0ff8-b5bd-4e25-b9ff-a2cbe97fe315.jpg%3Fv%3D1741897495

My presumption is because the bottom URL has %3Fv%3D1741897495 after .jpg. When I strip the url of %3Fv%3D1741897495 and try to load the image in the browser it fails with this error:

<Error>

<Code>AccessDenied</Code>

<Message>Access Denied</Message>

<RequestId>8WETQYBFJ3BGFV9S</RequestId>

<HostId>2rsp1tPcGhS6zb2KVnSc8Pk8z/h/N1lF1ur7FrtLf2rZXcZPtsworbxZuDtNyPX6zvvwhvePId0=</HostId>

</Error>

Any ideas?

Where is the URL that fails from? What expression/logic is generating it?

In a table:

https:current row’s inspiration pic’s image's URL

I add the in the https:

Both images open fine for me here. Does the error only occur when you try to send to Instagram?

@andrewmccalister - the Instagram API can be fickle.

Your second image is actually a .jpg(random chars) - instagram servers will be reading this as not a JPG file and/or not decoding the file correctly.

The way you’ve actually saved this in bubble’s file uploader is likely the issue (e.g. the file name is messed up).

Context: If you’ve ever used AWS S3 before (what bubble uses for file manager), any change in the string will result in this error ‘access denied’ (because it doesn’t exist).

1 Like

Sorry - I wasn’t clear.

Both the URLs I posted work fine. However, the second URL gets an error from the instagram API, and the only difference I can see between the URLs that works and doesn’t work is what comes after the .jpg.I tried to remove the content after the .jpg(%3Fv%3D1741897495) which then produces an error when you open it in a browser - https://2b38a319ca4d80724496d675e3d5201d.cdn.bubble.io/f1755741232317x661348103940845700/111484_5_a63e0ff8-b5bd-4e25-b9ff-a2cbe97fe315.jpg

  1. Is the reason the Instagram API is rejecting it because of what’s after the .jpg?
  2. What does the %3Fv%3D1741897495 in the URL represent?
  3. Is there a way to clean up the URL so that it ends with .jpg

so you don’t believe the %3Fv%3D1741897495is causing the error?

What do you think is wrong with the filename?

@andrewmccalister you’ve somehow managed to save the filename with jpg%3Fv%3D1741897495

I think that you’re using the saved to bubble storage operator, you should be able to override this using a custom file name.

here’s an example using your first link: https://0a78d0b5b00f23e46da87ec91dbb8783.cdn.bubble.io/f1773619723242x866999789661179100/JM-1009-39_30.jpg%3Fv%3Dtechnicallyshouldnotwork