Forum Discussion

DarioJG's avatar
DarioJG
Explorer | Level 4
8 years ago
Solved

no media info for PNG files in v2 API: /list_folder

Hi, I am trying to filter images (PNG files) and videos (.mov files) from the list received in /list_folder response. In API v1 we had the mimeType which was simple and efficient.

In v2 API I am trying to use the media_info structure, but unfortunately it is not returned for PNG files.

Also, the media_info does not allow to diferentiate files like mimeType permited (for example .mov from .avi or .png from .jpg) is there another way other than checking the filename extension to do this?

 

Example response:

"entries": [
    {
      ".tag": "file",
      "name": "bearAs-alpha.moveText-alpha.mov",
      "path_lower": "/overlays/bearas-alpha.movetext-alpha.mov",
      "path_display": "/overlays/bearAs-alpha.moveText-alpha.mov",
      "id": "id:YZb3V2wJUkAAAAAAAAAADg",
      "client_modified": "2017-01-17T19:44:42Z",
      "server_modified": "2017-02-24T15:22:51Z",
      "rev": "14b531bef6e",
      "size": 56716,
      "media_info": {
        ".tag": "metadata",
        "metadata": {
          ".tag": "video",
          "dimensions": {
            "height": 600,
            "width": 600
          },
          "duration": 0
        }
      },
      "content_hash": "7687ef246ee232d9adfc50cdb902d5d898aea6addd752572e9e9072287525293"
    },
    {
      ".tag": "file",
      "name": "bearJPG.jpg",
      "path_lower": "/overlays/bearjpg.jpg",
      "path_display": "/overlays/bearJPG.jpg",
      "id": "id:YZb3V2wJUkAAAAAAAAAADQ",
      "client_modified": "2017-01-17T19:44:41Z",
      "server_modified": "2017-02-24T15:22:51Z",
      "rev": "14c531bef6e",
      "size": 52650,
      "media_info": {
        ".tag": "metadata",
        "metadata": {
          ".tag": "photo",
          "dimensions": {
            "height": 600,
            "width": 600
          }
        }
      },
      "content_hash": "bd28df65c638e14c7c880a7f81b115a4f68fd30f4c5111816bb19291f7a26191"
    },
    {
      ".tag": "file",
      "name": "LaTierra-NoAudio-Explosion.avi",
      "path_lower": "/overlays/latierra-noaudio-explosion.avi",
      "path_display": "/overlays/LaTierra-NoAudio-Explosion.avi",
      "id": "id:YZb3V2wJUkAAAAAAAAAASg",
      "client_modified": "2017-02-14T16:47:08Z",
      "server_modified": "2017-02-24T15:22:51Z",
      "rev": "14e531bef6e",
      "size": 10271744,
      "media_info": {
        ".tag": "metadata",
        "metadata": {
          ".tag": "video",
          "dimensions": {
            "height": 384,
            "width": 512
          },
          "duration": 17033
        }
      },
      "content_hash": "204416633101d21085ea55372b0319469004ece50cf6c2b84b056426766d83e5"
    },
    {
      ".tag": "file",
      "name": "rightBear.png",
      "path_lower": "/overlays/rightbear.png",
      "path_display": "/overlays/rightBear.png",
      "id": "id:YZb3V2wJUkAAAAAAAAAAOw",
      "client_modified": "2017-02-08T22:56:41Z",
      "server_modified": "2017-04-17T16:23:19Z",
      "rev": "367531bef6e",
      "size": 85705,
      "content_hash": "e30da824cb832fb62e9d8560a10bfcbda7774abd170aabb9559c80199ee711eb"
    }
  ],

 

  • Thanks for the post! This is expected, media information won't be returned for all media types. With API v2, you should use the file extension in place of the mime type. I'll be sure to pass this along as feedback though.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    Thanks for the post! This is expected, media information won't be returned for all media types. With API v2, you should use the file extension in place of the mime type. I'll be sure to pass this along as feedback though.
    • DarioJG's avatar
      DarioJG
      Explorer | Level 4
      Understood, thanks for the quick reply. As additional feedback, I think PNG (or any other graphic file format for that matter) should receive the same treatement as a JPG file and hence include the media_info information (regardless the fact that jpg might be the most popular format for photos). Perhaps media_info should include additional information in that case (a file format field for example).

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 10 hours ago
350 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!