DEV Community

Author
Author

Posted on • Edited on

Photos from OneDrive to HTML

I have a huge library of media on cloud storage platforms. One such platform is Microsoft OneDrive. While I uploaded some files to OneDrive today, curiosity struck me as to whether OneDrive provided some type of HTML safe URL for the files it stores. Although most storage providers enable the ability to embed a widget, not all storage providers allow directly downloading the file via an <img> or <video> tag.

A quick search got me to the answer, and a bit of experimenting later yielded this answer.

What's the benefit of this

It is possible use Microsoft OneDrive as file storage for website media.

One downside of this approach, though, is the lack of metadata which would allow for putting a descriptive alt attribute on the elements. A non-descriptive alt attribute can be cobbled together from data which the API provides, yet, to do the intended use, this approach would have to be supplemented with a solution for alt.

Another Investigation Done

May this article save you this many tabs!

Closing the Tabs

Have A Good One ☝!

Top comments (0)