Please go to our [discussion forum](https://github.com/spencerwooo/onedrive-vercel-index/discussions) for general questions and FAQs, **issues are for bug reports and bug reports only.** Feature requests may or may not be ignored, as [I (@spencerwooo)](https://spencerwoo.com) am the only one maintaining the project, so **I only prioritise features that I use.**
<table><tbody><tr><td><ahref="https://drive.spencerwoo.com/Lecture%20and%20Coursework%20CS%20(BIT)/2019%20-%20%E5%A4%A7%E4%B8%89%E4%B8%8B%20-%20%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E4%B8%8E%E8%AE%BE%E8%AE%A1/n1570.pdf"target="_blank"rel="noopener noreferrer">File preview</a></td><td><ahref="https://drive.spencerwoo.com/%F0%9F%8D%8A%20Weibo%20emotes/Source1/%E5%BE%AE%E5%8D%9A%E2%80%9C%E9%BB%84%E8%84%B8%E2%80%9D"target="_blank"rel="noopener noreferrer">Image preview</a></td><td><ahref="https://drive.spencerwoo.com/%F0%9F%8D%A1%20Genshin%20PV/New%20version%20PV/TGA2021%E3%80%8A%E5%8E%9F%E7%A5%9E%E3%80%8B%E5%8F%82%E9%80%89%E8%A7%86%E9%A2%91.mp4"target="_blank"rel="noopener noreferrer">Video and audio</a></td></tr><tr><td>PDF, EPUB, markdown, code, plain text</td><td>Also in gallery mode</td><td>mp4, mp3, ..., play online or with IINA, PotPlayer...</td></tr><tr><td><ahref="https://drive.spencerwoo.com/Lecture%20and%20Coursework%20CS%20(BIT)/2017%20-%20%E5%A4%A7%E4%BA%8C%E4%B8%8A%20-%20%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1%20%E7%BB%AA%E8%AE%BA.pptx"target="_blank"rel="noopener noreferrer">Office preview</a></td><td><ahref="https://drive.spencerwoo.com/%F0%9F%A5%9F%20Some%20test%20files/Articles"target="_blank"rel="noopener noreferrer">README.md preview</a></td><td><ahref="https://drive.spencerwoo.com/%F0%9F%A5%9F%20Some%20test%20files/Imagenette"target="_blank"rel="noopener noreferrer">Pagination</a></td></tr><tr><td>docx, pptx, xlsx, ...</td><td>Also renders code blocks, images with relative links, ...</td><td>For folders with 200 or more items</td></tr><tr><td><ahref="https://drive.spencerwoo.com/%F0%9F%8C%9E%20Private%20folder"target="_blank"rel="noopener noreferrer">Protected folders</a></td><td><ahref="https://drive.spencerwoo.com/%F0%9F%8D%8A%20Weibo%20emotes/Source2"target="_blank"rel="noopener noreferrer">Multi-file download</a></td><td>... and more!</td></tr><tr><td>Password protected routes and files, <ahref="#password-protected-folders">details down here</a> ↓</td><td>Compress and download multiple files or folders, <ahref="#multi-file-and-folder-download">details down here</a> ↓ </td><td>Permalink copy, direct raw-file serving, dark mode, customisations...</td></tr></tbody></table>
The authentication tokens and variables are the same as what you configured in the [`onedrive-cf-index`](https://github.com/spencerwooo/onedrive-cf-index) project. Detailed documentations can also be found there (for now). This project is at its early stages, for discussions *please, please, please* post to the [discussion forum](https://github.com/spencerwooo/onedrive-vercel-index/discussions).
We use JSZip to download all files in-browser and compress them into file blobs, which are then downloaded to your device as a `zip` file. This is extremely useful if a series of small files are to be downloaded, but it could be time consuming if used for bulk-downloading a few large files.
Folders are traversed and recursively fetched into the compressed zip. Multiple files or folders can be selected and downloaded side-by-side.
Yes, it can be used as an image (or any kind of file) online storage, where the raw file link is exported and can be embedded into your blog or other websites. Images, videos, songs, PDFs..., you name it.
In order to speed up (I doubt it would?) download speed when files are directly served on OneDrive servers, we can leverage a proxied download which relays the file download stream through Vercel Serverless first, then back to our own device.
You can download a file via this method by either clicking on the `Proxy download` button beside the normal `Download` button in file preview pages ...
... or craft the API request yourself:
```http
GET /api/proxy?url=<URL_ENCODED_DIRECT_FILE_LINK>
```
Only thing to keep in mind is that the parameter `url` should be a direct OneDrive file link that is URL encoded. An example is shown below:
> An `&inline=true` parameter is also accepted here, where the response header `content-disposition` of the direct file stream from OneDrive is replaced from `attachment, filename*=...` to `inline, filename*=...`. This only applied to PDF files with a header `content-type` of `application/pdf`, so that the PDF returned can be viewed inside the browser, instead of being force downloaded.
*Feature parity with original project: [Proxied / raw file download](https://github.com/spencerwooo/onedrive-cf-index#%EF%B8%8F-proxied--raw-file-download).*