Sub topic 11
Delivering Files and Controlling Access
Assume you know how to create and export documents, organize lessons into modules, and use the basic file and permission settings in your learning management system (LMS). This chapter focuses on delivering downloadable resources reliably while limiting access to the people and time period you intend.
Choose an access model
A downloadable file needs two separate decisions:
- How learners receive the file.
- Who can open the file and for how long.
The simplest delivery method is a public URL. Anyone with the link can usually download the file. This works for openly licensed checklists or sample files, but it is unsuitable for paid course materials.
An authenticated download requires the learner to sign in and meet an access rule. For example, the learner may need to be enrolled in the course or have completed a preceding lesson. The LMS checks the rule before allowing the download.
An expiring link gives temporary access to a private file. The LMS or storage service creates a URL that stops working after a set time. This is useful when files are stored outside the LMS, such as in private cloud storage.
| Access model | Suitable for | Main risk |
|---|---|---|
| Public URL | Open resources and promotional materials | The link can be shared |
| Authenticated download | Paid or enrollment-only resources | Incorrect permissions can block valid learners |
| Expiring link | Private files in external storage | The link may expire during a download |
Enforce access on the server
Hiding a download button is not access control. A learner can still copy a file URL or inspect page code. The server must check authorization every time it serves a protected file.
Keep the original file in private storage. Expose it only through an authenticated route or a short-lived signed URL. A signed URL is a URL containing a cryptographic signature that proves the storage service authorized the request.
A policy function might look like this:
function canDownload(user, resource) {
if (!user || !user.id) return false;
if (resource.visibility === "public") return true;
if (!user.enrolledCourseIds.includes(resource.courseId)) return false;
if (resource.requiredLessonId &&
!user.completedLessonIds.includes(resource.requiredLessonId)) {
return false;
}
return true;
}
const user = {
id: "u-42",
enrolledCourseIds: ["course-7"],
completedLessonIds: ["lesson-2"]
};
const resource = {
visibility: "enrolled",
courseId: "course-7",
requiredLessonId: "lesson-2"
};
console.log(canDownload(user, resource)); // trueThis example checks permission, but it does not deliver a file. In production, the authorized server would record the request and return a temporary link or stream the private file. Do not place secret storage credentials in browser code.
Make delivery reliable
Use a descriptive filename, such as module-2-project-brief.pdf, rather than download-final-v3.pdf. Display the file type and size before download. Keep the file in a stable location so links do not break when you revise a lesson.
Test these cases before launch:
- An enrolled learner can download the file.
- A logged-out visitor cannot access a protected file.
- A learner in another course receives a denial.
- A revoked or expired link no longer works.
- A mobile learner can open the file.
- The filename and file type match the visible description.
Exercise
You have a paid worksheet that should be available only after Lesson 2. Which control should you use, and where must the check happen?
Show answer
Store the worksheet privately, require authentication and enrollment, check Lesson 2 completion on the server, and then issue a temporary download link.