Hello, Dev Community! π
Today, I want to share with you my journey of creating a File Management System using PHP and MySQL. This project is a great way to learn about file uploads, database interactions, and overall web application development. Letβs dive in! π
π Project Overview
The File Management System allows users to:
- Upload files π€
- View uploaded files π
- Update file details βοΈ
- Delete files ποΈ
It's a straightforward web application that can be used for various purposes, such as managing documents, images, or any other file types.
π οΈ Tech Stack
- PHP: For server-side scripting
- MySQL: To manage the database
- Bootstrap: For responsive UI design
- Font Awesome: For icons
- HTML/CSS: For structuring and styling the web pages
π» Features
- File Uploads: Users can easily upload files through a user-friendly interface.
- File Management: View, update, and delete files as needed.
- Privacy & Terms: Includes dedicated pages for privacy policy and terms of service to keep users informed.
π¦ File Structure
Here's a quick look at the file structure of the project:
file-management-system/
βββ delete.php # Script to delete files
βββ index.php # Home page
βββ privacy_policy.php # Privacy policy page
βββ terms_of_service.php # Terms of service page
βββ update.php # Update file details
βββ upload.php # Handle file uploads
βββ uploads.sql # SQL file for database setup
βββ upload_form.php # File upload form
βββ view_files.php # View uploaded files
βββ _Footer.php # Footer component
βββ _Nav.php # Navigation component
βββ conn.php # Database connection file
π How It Works
-
Uploading Files:
- Users can select files from their local system and upload them.
- The files are stored in a designated folder, and their paths are saved in the database.
-
Viewing Files:
- Users can see a list of uploaded files with options to download or delete them.
-
Updating Files:
- Users can edit file details, like changing the file name.
π‘ Getting Started
If youβre interested in trying it out, hereβs how to set it up locally:
- Clone the repository:
git clone https://github.com/Anticoder03/file-management.git
- Navigate to the project folder:
cd file-management-system
- Import the SQL file to your MySQL database.
-- import uploads.sql
-
Configure the database connection in
conn.php
.
<?php
// Database configuration
$servername = "localhost";//hostname
$username = "root"; //username
$password = ""; //password
$dbname = "file_management"; //databasename
// Create a new MySQLi connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check the connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} else {
// echo "Connected successfully!";
}
?>
- Run the application in your web browser:
http://localhost/file-management/index.php
π Conclusion
Creating this File Management System was a rewarding experience that allowed me to solidify my understanding of PHP and MySQL. I encourage you to try building your own projects and share your experiences with the community!
Feel free to check out the project on GitHub and let me know your thoughts! π¬
π€ Whatβs Next?
I plan to enhance this project by adding user authentication and more advanced file management features. Stay tuned for updates! π
Thank you for reading! If you found this post helpful, give it a π and share your thoughts in the comments below! Happy coding! π¨βπ»π©βπ»
Top comments (0)