Skip to content

Upload externally hosted media resources

Campbell Allen edited this page Aug 18, 2016 · 2 revisions

Externally hosted images can be uploaded using the client as well. Just append the mime type and the location for each media resource to the subject locations.

Take note that the external URL must use the secure https protocol and the media resource MIME type is an approved one, currently: .jpg, .jpeg, .png, .gif, .svg.

subject = Subject()
subject.locations.append({'image/png': 'https://example.com/image.png'})
subject.save()

If you get a 'Locations is invalid' error message please check the mime type is a valid and allowed mime type.