> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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: downloadFolder(folderId: string)

# Method package: wixMediaBackend

# Method menu location: wixMediaBackend --> MediaManager --> downloadFolder

# Method Link: https://dev.wix.com/docs/velo/apis/wix-media-backend/media-manager/download-folder.md

# Method Description:

Returns a download URL for downloading a folder from the Media Manager.

The `downloadFolder()` function returns a Promise that resolves to a download URL 
 for a Media Manager folder's files and sub-folders.

 A compressed file is created and can be downloaded using the download URL. The 
 compressed file can contain up to 1000 files. Sub-folders are included. The name 
 of the top-level folder requested for download isn't included.

 Call the [`wix-location.to()`](https://dev.wix.com/docs/velo/apis/wix-location-frontend/to.md) 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 a folder.
 To get 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.



# 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 folder's contents

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { mediaManager } from 'wix-media-backend';

/* Sample folderId value:
 * '0abec0_bed6f8efb53348379b2011514254e954'
 */

export const myDownloadFolderFunction = webMethod(Permissions.Anyone, (folderId) => {
  return mediaManager.downloadFolder(folderId)
    .then((downloadUrl) => {
      return downloadUrl;
    })
    .catch((error) => {
      console.error(error);
    });
});

/* Promise resolves to a download URL similar to:
 * 'https://archive.wixmp.com/archive/wix/2d8d9ffc016c443387e42abf8e459c66'
 */
```

---