Skip to content

fshare, online file sharing app, which is crete on -Nodejs,mongose,ejs templates. After uploading any kind of file copy share link and donwload !

Notifications You must be signed in to change notification settings

Nikhil201Gurjar/fshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fshare GitHub package.json version

A file sharing app, using 'EJS templates'

fshare, is a fullstack project, which is help the user to upload any file, and after sharing get the donwload file link or share with specific user who want to download.Also have the features, its automatically delete file after 24 hour. After getting the link ,users can share via Email, whatsapp or use of other chat plateform.But didnot upload file upto 100 MB.

Indexing the contents

Badges

GitHub Repo stars GitHub watchers

GitHub top language GitHub code size in bytes GitHub repo file count GitHub commit activity GitHub last commit

fshare looks like

fshare_home fshare_link

fshare_download

Go Home

Demo

fshare_home fshare_download

Go Home

Tech Stack

Server: NodeJS, ExpressJS, MongoDB, EJS

Go Home

Run Locally

Clone the project

  git clone https://github/Nik4Furi/fshare

Go to the project directory

  cd fshare

Install dependencies

  npm install

Start the server

  npm run start (start at only time)

  npm run dev (Run or restart, whenever you save any file(js))

Go Home

Environment Variables

To run this project, you will need to add the following environment variables to your .env file also can see .env.exmaple file

Server Configurations

PORT = 8000 URL = http://localhost

Database configurations

DB_SERVER
DB_HOST
DB_PORT
DB_NAME

Session key configurations

SECRET_SESSION

Go Home

Color Reference

Color Hex
Primary Color #0d6efd

Go Home

Routers Reference

Home Page

  GET /
Parameter Type Description
- get See our home page,where we upload files

Upload File

  POST /upload
Parameter Type Description
- POST file must be required.To upload a file into database

Show File To Download

  GET /show/:uuid
Parameter Type Description
uuid GET uuid must be required.Because show the details of given uuid match file

Download File

  GET /download/:uuid
Parameter Type Description
uuid GET uuid must be required.Because donwload file only uuid match

Go Home

Usages / Examples

Deleting the file,which are 24 hour delay.

const DeleteDoc24Hour = async(Modal)=>{
    const today = new Date(Date.now());
    today.setHours(0,0,0,0);
    
    await Modal.deleteMany({createdAt : {$lt:today}});
}

module.exports =  DeleteDoc24Hour

Uploading the files ,using this middleware

//---------import the dependies to uploads files
const multer = require('multer');
const path = require('path');

//Define the storage where to save our files
const Storage = multer.diskStorage({
    destination : 'uploads',
    filename : (req,file,cb)=>{
        const uniqueName = `${Date.now()}-${Math.floor(Math.random() * 1E9)}${path.extname(file.originalname)}`;
        cb(null,uniqueName);
    }
})

//Define the uploads with some limitations
const Upload = multer({
    storage : Storage,
    limits : {fileSize : 1000 * 1000 * 100}
}).single('myfile')

module.exports = Upload; 

Go Home

Features

  • Delete any file which is late from 24 hour
  • Upload any kind of file, but its not more than 100 MB
  • Use Components
  • Basec On MVC Architecture

Go Home

Related Projects

Here are some related projects

inotes_api

urlShortener_api

About

fshare, online file sharing app, which is crete on -Nodejs,mongose,ejs templates. After uploading any kind of file copy share link and donwload !

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published