Skip to content

Password Protect Files and Folders

By , Customer Success DirectorUpdated

Open this page in a new chat

Short answer

Go to Settings > Domains in your Sirv account, open Protected URLs and add HTTP Basic Authentication to the folder you want to protect. Anyone who opens a file in that folder must then enter a username and password. Domain restriction, signed URLs and watermarks are other ways to protect files.

After reading this you will know

  • How to password protect a folder in Sirv
  • What visitors see when they open a protected file
  • Which other ways you can protect files

You can protect the contents of a folder with HTTP authentication. To visit the URL of a file in the folder, a username and password will be required. (To control who can change the folder in your account instead, limit user access to folders or lock the folder.)

The /Example-Folder/ folder of the demo.sirv.com account has been protected. Try to visit this image URL:

https://demo.sirv.com/Example-Folder/lv-M46197_PM2_Front.jpg

When you provide the following username/password, the file will load:

User: Example
Pass: StrongPassword%50

Follow these steps to protect the contents of a folder with a password:

  1. Go to the Settings > Domains section of your account to find the Protected URLs settings:
Protected URLs section in Sirv account

If you don’t see that section, ask the Sirv support team if they can enable protected file features on your account.

  1. Click the link “Manage Protected URLs”.

  2. Click + to create a new protection:

Create a new protection to protect your images from being seen or scraped
  1. Choose HTTP Basic Authentication and click Next:
Choose HTTP authentication on a folder, requiring a username/password to view any file inside the folder
  1. Click to select the folder path you want to protect. You’ll then see a list of all your folders:
Choose the folder to be protected with HTTP auth
  1. Click + to create a new login (“user”):
Click the + icon to create a new HTTP auth user
  1. Enter any username and password you desire. Optionally, you can enter a date when the login should stop working. Then click Add:
Enter the username, password and expiry date for the HTTP auth login
  1. Click Create. Your login has been created. Now, all files in that folder (and it sub-folders) are protected.

    They can only be seen by providing a valid username and password. It is called a “user” but anyone who knows the username and password will be able to view the files.

    Up to 5 username/password configurations can be set for each HTTP folder protection.

Sirv also provides other ways to protect files from being viewed:

  • Domain protection - you can enable domain restriction to block direct requests and specify which domains may display your images (whitelisting).
  • JWT protection - you can enable JWT signed URLs so that only URLs containing a valid token can be served.
  • Watermarks - you can apply image or text watermarks to your images. They can be made irremovable with JWT protection.
Back to top