A web-based file server application designed for school intranet use, enabling teachers to upload and share educational materials with students via touch screen digital class boards.
- 🎯 Touch-Optimized Interface: Designed for touch screen digital class boards
- 📱 Responsive Design: Works on various screen sizes and devices
- 🔒 Offline Capability: No internet connection required
- 📁 File Management: Support for PDF, images, videos, audio, and documents
- 🎨 Full-Screen Viewing: Immersive viewing experience for all media types
- 📄 PDF Presentation Mode: Navigate through PDF pages with forward/backward buttons
- 👥 User Management: Admin and teacher accounts with role-based permissions
- 🏫 Class Organization: Files organized by class and subject structure
- Backend: .NET 9 (ASP.NET Core MVC)
- Database: SQLite (portable, no server required)
- Frontend: Razor Views with Tailwind CSS
- Authentication: Cookie-based authentication
- File Storage: Local file system with virtual directory structure
- .NET 9 SDK
- Windows Server with IIS (for production deployment)
-
Clone and Navigate
git clone <repository-url> cd SchoolFileServer
-
Restore Dependencies
dotnet restore
-
Run the Application
dotnet run
-
Access the Application
- Open browser to:
http://localhost:5272 - Default admin login:
- Username:
admin - Password:
admin123
- Username:
- Open browser to:
-
Install IIS with ASP.NET Core Module
# Enable IIS Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-CommonHttpFeatures, IIS-HttpErrors, IIS-HttpRedirect, IIS-ApplicationDevelopment, IIS-NetFxExtensibility45, IIS-HealthAndDiagnostics, IIS-HttpLogging, IIS-Security, IIS-RequestFiltering, IIS-Performance, IIS-WebServerManagementTools, IIS-ManagementConsole, IIS-IIS6ManagementCompatibility, IIS-Metabase, IIS-ASPNET45 # Download and install ASP.NET Core Hosting Bundle # https://dotnet.microsoft.com/en-us/download/dotnet/9.0
- Publish for Production
dotnet publish -c Release -o "C:\inetpub\wwwroot\SchoolFileServer"
-
Create Application Pool
# In IIS Manager: # - Create new Application Pool named "SchoolFileServer" # - Set .NET CLR Version to "No Managed Code" # - Set Process Model Identity to "ApplicationPoolIdentity"
-
Create Virtual Directory Structure
Default Web Site └── SchoolFileServer (Application) ├── Physical Path: C:\inetpub\wwwroot\SchoolFileServer └── Application Pool: SchoolFileServer -
Set Permissions
# Grant IIS_IUSRS permissions to application directory icacls "C:\inetpub\wwwroot\SchoolFileServer" /grant "IIS_IUSRS:(OI)(CI)F" /T # Create uploads directory mkdir "C:\inetpub\wwwroot\SchoolFileServer\wwwroot\uploads" icacls "C:\inetpub\wwwroot\SchoolFileServer\wwwroot\uploads" /grant "IIS_IUSRS:(OI)(CI)F" /T
-
Update Connection String (if needed)
// appsettings.json { "ConnectionStrings": { "DefaultConnection": "Data Source=C:\\inetpub\\wwwroot\\SchoolFileServer\\SchoolFileServer.db" } }
-
Ensure Database Permissions
# Grant IIS_IUSRS permissions to database file (after first run) icacls "C:\inetpub\wwwroot\SchoolFileServer\SchoolFileServer.db" /grant "IIS_IUSRS:F"
- Browse to:
http://localhost/SchoolFileServer - Login with default credentials:
- Username:
admin - Password:
admin123
- Username:
The application organizes files in the following structure:
wwwroot/uploads/
├── Class VI/
│ ├── Mathematics/
│ ├── Science/
│ ├── English/
│ └── [Other Subjects]/
├── Class VII/
├── Class VIII/
├── Class IX/
├── Class X/
├── Class XI/
└── Class XII/
- Browse and view all files
- Access full-screen viewing mode
- Use PDF presentation mode
- No upload or administrative capabilities
- All anonymous user capabilities
- Upload files to assigned classes/subjects
- Create new subject folders
- Delete their own uploaded files
- All teacher capabilities
- Create and manage teacher accounts
- Access admin dashboard
- Delete any files
- Full system administration
- File Type Validation: Only allowed file types can be uploaded
- File Size Limits: Maximum 100MB per file
- Path Traversal Protection: Secure file path handling
- Content Type Validation: File content verification
- Role-Based Access Control: Different permissions for different user types
- Secure File Storage: Files stored outside web root when possible
- Documents: PDF, Word (.doc, .docx), PowerPoint (.ppt, .pptx), Excel (.xls, .xlsx), Text (.txt)
- Images: JPEG, PNG, GIF, BMP, WebP
- Videos: MP4, AVI, MOV, WMV, FLV, WebM
- Audio: MP3, WAV, FLAC, AAC, OGG
// appsettings.json
{
"DefaultCredentials": {
"AdminUsername": "admin",
"AdminPassword": "admin123"
}
}// appsettings.json
{
"FileUpload": {
"MaxFileSize": 104857600, // 100MB in bytes
"AllowedExtensions": [".pdf", ".jpg", ".jpeg", "..."]
}
}The application uses SQLite for easy deployment and portability. The database is automatically created on first run with:
- Default admin user (admin/admin123)
- Standard class structure (VI through XII)
- Required database schema
-
Database Permission Errors
# Ensure IIS_IUSRS has write access to the database file icacls "path\to\SchoolFileServer.db" /grant "IIS_IUSRS:F"
-
File Upload Errors
# Check uploads directory permissions icacls "C:\inetpub\wwwroot\SchoolFileServer\wwwroot\uploads" /grant "IIS_IUSRS:(OI)(CI)F" /T
-
Application Won't Start
- Verify ASP.NET Core Hosting Bundle is installed
- Check Application Pool settings (.NET CLR Version = "No Managed Code")
- Review IIS logs in
logs\stdoutdirectory
- Application Logs:
logs\stdoutdirectory - IIS Logs:
C:\inetpub\logs\LogFiles\W3SVC1\ - Windows Event Logs: Application and System logs
# Copy SQLite database file
copy "C:\inetpub\wwwroot\SchoolFileServer\SchoolFileServer.db" "C:\Backups\SchoolFileServer_$(Get-Date -Format 'yyyyMMdd').db"# Backup uploads directory
robocopy "C:\inetpub\wwwroot\SchoolFileServer\wwwroot\uploads" "C:\Backups\uploads_$(Get-Date -Format 'yyyyMMdd')" /E- Stop the application pool
- Backup current application and database
- Deploy new version using
dotnet publish - Start the application pool
- Static File Caching: Configured in web.config for 7 days
- Compression: Enabled for static content
- Database Indexing: Optimized indexes on frequently queried columns
- File Streaming: Large files are streamed rather than loaded into memory
The application is designed to be easily customizable for different school environments:
- Class Names: Modify the
SchoolClassseed data inSchoolFileContext.cs - File Types: Update allowed extensions in
FileService.csandappsettings.json - UI Styling: Tailwind CSS classes can be modified in views
- Upload Limits: Adjust in both
appsettings.jsonandweb.config
This project is designed for educational use in school environments.