Three directories needed to be created in parent directory for execution: (if you are downloading zip from GitHub or cloning the repo then this step is not necessary)
- chunks
- download
- file
Directory names are case sensitive
Refer MySQL installation process on Google corresponding to which Linux flavour/variant you are currently using
Change mysql username and password in sql_handler.h (line no. 17) to what you've setup during MySQL installation in your PC
The project.sql contains queries used while designing database of the project and same design can be installed on your PC hassle-free by just executing source project.sql
in MySQL shell.
How to run this program: (For LINUX based systems only)
- First navigate to the folder to which you've downloaded and extracted the code
- Execute the following commands in Linux Terminal
g++ -o index index.cpp -L/usr/include/mysql -lmysqlclient -I/usr/include/mysql
./index
Execute the following command in Linux Terminal
sudo systemctl start mysqld
Enter password if prompted and again execute
./index
If you are still getting Database connection failed message then Change mysql username and password in sql_handler.h (line no. 17) to what you've setup during MySQL installation in your PC
Note:
- While uploading a file please use the same filenames contained in file directory. If you want to upload your own file, then copy first it in file directory and then enter filename while execution of the project
- Downloaded file will be stored in download directory
- Chunks generated after uploading a file will be stored in chunks directory
- Writing metadata of file formats (like .png, .jpg, .docx) fails while downloading the file (uploading works perfectly).