Shashank Madan - Upload files to Azure Blob Storage #1925
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Upon successful upload or link submission, the system performs the following:
Features
Input Specifications
Accepts:
task_id(required)student_id(from authenticated session or explicitly)Validations
.pdf,.docx,.txt,.png,.jpgLogic Flow
On Success:
submission_linkfield of the student's task record.submission_time.On Failure:
Main Changes Explained
How to Test
Prerequisites: Azure Blob Storage Setup (Free Tier)
1. Create Azure Account
2. Create Storage Account
hgn-resources).hgnstorage123).3. Create Blob Container
student-files).4. Get Connection String
key1orkey2.5. Update
.envFileAdd these two variables to your
.envfile (replace the connection string with the one copied in Step 4):Execution Steps
1. Setup Local Environment
2. Authentication
POSTrequest tohttp://localhost:4500/api/loginwith the body:{ "email": "", "password": "" }3. Get User ID
GETrequest to:http://localhost:4500/api/userProfile/singleName/{your first name or last name here}_id(User ID) of your current login account.4. Create a Task
POSTrequest tohttp://localhost:4500/api/education-tasks.{ "name": "Test task", "status": "assigned", "lessonPlanId": "68ed6e6e746d9b633a6158f2", "atomIds": ["68def3a5f0844c6916607a9c"], "type": "write", "dueAt": "2025-10-24T00:00:00.000+00:00", "studentId": "{Your_User_ID_Here}" }5. Test API: Upload a File
POSTrequest to:http://localhost:4500/api/student/tasks/{your_task_id}/uploadfile(select "File" type from the dropdown on the right of the key field).6. Verify Success
GETrequest to:http://localhost:4500/api/education-tasks/{your_task_id}statushas changed to completed.completedAtis updated to today's date.uploadUrls.7. Cleanup
Screenshots or videos of changes:
Postman.2025-11-27.10-41-55.mp4