File analysis on upload

When uploading files to your project, we can extract file data that you can use to your benefit:

  • Basic file information, e.g. EXIF.
  • Insights into its content.
  • Optional file analyses (e.g. virus checking or object recognition).

You can use this data to validate and moderate incoming files.

File and content info

Right after the file is received by us, we can return to you information about the file and its content. We also look inside it to identify the correct MIME type.

API response example:

1{
2 "datetime_removed": null,
3 "datetime_stored": "2018-11-26T12:49:10.477888Z",
4 "datetime_uploaded": "2018-11-26T12:49:09.945335Z",
5 "is_image": true,
6 "is_ready": true,
7 "mime_type": "image/jpeg",
8 "original_file_url": "https://ucarecdn.com/22240276-2f06-41f8-9411-755c8ce926ed/pineapple.jpg",
9 "original_filename": "pineapple.jpg",
10 "size": 642,
11 "url": "https://api.uploadcare.com/files/22240276-2f06-41f8-9411-755c8ce926ed/",
12 "uuid": "22240276-2f06-41f8-9411-755c8ce926ed",
13 "variations": null,
14 "content_info": {
15 "mime": {
16 "mime": "image/jpeg",
17 "type": "image",
18 "subtype": "jpeg"
19 },
20 "image": {
21 "format": "JPEG",
22 "width": 500,
23 "height": 500,
24 "sequence": false,
25 "orientation": 6,
26 "geo_location": {
27 "latitude": 55.62013611111111,
28 "longitude": 37.66299166666666
29 },
30 "datetime_original": "2018-08-20T08:59:50",
31 "dpi": [
32 72,
33 72
34 ]
35 }
36 },
37}

On uploading the file is assigned an attribute is_image. If this attribute is true, then processing operations can be applied to the file.

When processing high resolution (75+ MP) images, be aware of limitations.

Optional data analysis

Currently it includes:

API response example:

1{
2 "appdata": {
3 "uc_clamav_virus_scan": {
4 "data": {
5 "infected": true,
6 "infected_with": "Win.Test.EICAR_HDB-1"
7 },
8 "version": "0.104.2",
9 "datetime_created": "2021-09-21T11:24:33.159663Z",
10 "datetime_updated": "2021-09-21T11:24:33.159663Z"
11 },
12 "remove_bg": {
13 "data": {
14 "foreground_type": "person"
15 },
16 "version": "1.0",
17 "datetime_created": "2021-07-25T12:24:33.159663Z",
18 "datetime_updated": "2021-07-25T12:24:33.159663Z"
19 },
20 "aws_rekognition_detect_labels": {
21 "data": {
22 "LabelModelVersion": "2.0",
23 "Labels": [
24 {
25 "Confidence": 93.41645812988281,
26 "Instances": [],
27 "Name": "Home Decor",
28 "Parents": []
29 },
30 {
31 "Confidence": 70.75951385498047,
32 "Instances": [],
33 "Name": "Linen",
34 "Parents": [
35 {
36 "Name": "Home Decor"
37 }
38 ]
39 },
40 {
41 "Confidence": 64.7123794555664,
42 "Instances": [],
43 "Name": "Sunlight",
44 "Parents": []
45 },
46 {
47 "Confidence": 56.264793395996094,
48 "Instances": [],
49 "Name": "Flare",
50 "Parents": [
51 {
52 "Name": "Light"
53 }
54 ]
55 },
56 {
57 "Confidence": 50.47153854370117,
58 "Instances": [],
59 "Name": "Tree",
60 "Parents": [
61 {
62 "Name": "Plant"
63 }
64 ]
65 }
66 ]
67 },
68 "version": "2016-06-27",
69 "datetime_created": "2021-09-21T11:25:31.259763Z",
70 "datetime_updated": "2021-09-21T11:27:33.359763Z"
71 }
72 }
73}