> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: downloadFiles(fileUrls: Array) # Method package: wixMediaBackend # Method menu location: wixMediaBackend --> MediaManager --> downloadFiles # Method Link: https://dev.wix.com/docs/velo/apis/wix-media-backend/media-manager/download-files.md # Method Description: Returns a download URL for downloading files from the Media Manager. The `downloadFiles()` function returns a Promise that resolves to a download URL for the specified file(s) in the Media Manager. A compressed file is created and can be downloaded using the download URL. The compressed file can contain up to 1000 files. Call the [`wix-location.to()`](wix-location-frontend/to) function with the returned download URL as the external web address. This opens the Download bar in your browser. This function provides a permanent URL for downloading one or more files. To retrieve a temporary download URL for a single file, use the [`getDownloadUrl()`](https://dev.wix.com/docs/velo/api-reference/wix-media-backend/media-manager/get-download-url.md) function. >**Note:** The `downloadFiles()` function only allows you to download files with supported media types, and files that are explicitly listed in the Media Manager. Files with unsupported media types such as 'model', and files that aren't explicitly listed in the Media Manager such as default files in a gallery component, can't be downloaded using the `downloadFiles()` function. The supported media types are listed in the description for the `mediaType` return in the [`getFileInfo()`](https://dev.wix.com/docs/velo/api-reference/wix-media-backend/media-manager/get-file-info.md) function. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get a download URL for a single file ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { mediaManager } from 'wix-media-backend'; export const myDownloadFilesFunction = webMethod(Permissions.Anyone, (fileUrls) => { return mediaManager.downloadFiles(fileUrls) .then((downloadUrl) => { return downloadUrl; }) .catch((error) => { console.error(error); }); }); /* Promise resolves to a URL similar to: * "https://archive.wixmp.com/archive/wix/4c492536c61a495ca4b4526d71439a64" */ ``` ## Get and go to a download URL for all files ```javascript /************************************** * Page code * **************************************/ import wixLocationFrontend from 'wix-location-frontend'; import { myListFilesFunction, myDownloadFilesFunction } from 'backend/media.web'; $w.onReady(function () { // ... myListFilesFunction() .then((myFiles) => { const fileUrls = myFiles.map(file => file.fileUrl); myDownloadFilesFunction(fileUrls) .then((downloadUrl) => { wixLocationFrontend.to(downloadUrl); }); }) .catch((error) => { console.error(error); }); }); /************************************** * Backend code - media.web.js * **************************************/ import { Permissions, webMethod } from 'wix-web-module'; import { mediaManager } from 'wix-media-backend'; export const myListFilesFunction = webMethod(Permissions.Anyone, () => { return mediaManager.listFiles() .then((myFiles) => { return myFiles; }) .catch((error) => { console.error(error); }); }); export const myDownloadFilesFunction = webMethod(Permissions.Anyone, (fileUrls) => { return mediaManager.downloadFiles(fileUrls) .then((downloadUrl) => { return downloadUrl; }) .catch((error) => { console.error(error); }); }); ``` ---