β
Assignment system is working with mock uploads
β For production file uploads, please configure Cloudinary
The assignment system currently uses mock file uploads for development. You can:
- β Upload files (they'll show as "uploaded" in the UI)
- β Create assignments with file attachments
- β Test all assignment functionality
- β Files aren't actually stored (mock URLs are used)
- Go to cloudinary.com
- Sign up for a free account
- Note your Cloud Name from the dashboard
- In your Cloudinary dashboard, go to Settings β Upload
- Scroll down to Upload presets
- Click Add upload preset
- Configure the preset:
- Preset name:
assignment_uploads - Signing Mode:
Unsigned - Resource Type:
Auto - Allowed formats:
pdf,doc,docx,txt,jpg,jpeg,png - Max file size:
10485760(10MB) - Folder:
assignments(optional)
- Preset name:
- Save the preset
Add to your .env.local file:
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name_here- Restart your development server
- Try uploading a file in the assignment form
- Files should now upload to Cloudinary and return real URLs
If you prefer not to use Cloudinary, you can implement local file storage:
- Create an upload API route in
src/app/api/upload/route.ts - Use
multeror similar for file handling - Store files in
public/uploads/directory - Update the
handleFileUploadfunction to use your API
- Upload presets should be unsigned for client-side uploads
- Consider implementing file type validation server-side
- For production, consider signed uploads for better security
- Implement file scanning for malware if handling user uploads
- 400 Bad Request: Upload preset doesn't exist or is misconfigured
- 401 Unauthorized: Cloud name is incorrect
- 413 Payload Too Large: File exceeds size limits
- 415 Unsupported Media Type: File type not allowed in preset
Without Cloudinary configuration, the system will:
- Accept file uploads
- Show success messages
- Store mock file URLs
- Allow full assignment functionality
- Display file names and download links (that lead to example URLs)
This allows you to develop and test the assignment system without needing to set up file storage immediately.