{"id":22432697,"url":"https://github.com/1999azzar/flask-simple-file-server","last_synced_at":"2025-03-27T07:42:48.677Z","repository":{"id":215677051,"uuid":"739527056","full_name":"1999AZZAR/Flask-Simple-File-Server","owner":"1999AZZAR","description":"FSFS is a lightweight Flask-based file server, efficient and user-friendly solution for handling diverse file formats seamlessly.","archived":false,"fork":false,"pushed_at":"2024-03-06T14:41:43.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T12:45:50.372Z","etag":null,"topics":["api","filemanagement","filesystem","flask-application","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1999AZZAR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-05T19:30:00.000Z","updated_at":"2024-01-22T17:21:06.000Z","dependencies_parsed_at":"2024-03-04T16:14:26.742Z","dependency_job_id":"5728616f-5c34-40ea-a6e7-01754637fda3","html_url":"https://github.com/1999AZZAR/Flask-Simple-File-Server","commit_stats":null,"previous_names":["1999azzar/flask-simple-file-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2FFlask-Simple-File-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2FFlask-Simple-File-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2FFlask-Simple-File-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2FFlask-Simple-File-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1999AZZAR","download_url":"https://codeload.github.com/1999AZZAR/Flask-Simple-File-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806043,"owners_count":20675291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","filemanagement","filesystem","flask-application","python"],"created_at":"2024-12-05T22:12:35.838Z","updated_at":"2025-03-27T07:42:48.652Z","avatar_url":"https://github.com/1999AZZAR.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Simple File Server (FSFS)\n\n## Table of Contents\n\n- [Flask Simple File Server (FSFS)](#flask-simple-file-server-fsfs)\n  - [Table of Contents](#table-of-contents)\n  - [Introduction](#introduction)\n  - [Features](#features)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [API Endpoints](#api-endpoints)\n    - [1. Upload File](#1-upload-file)\n    - [2. Download File](#2-download-file)\n    - [3. List Files](#3-list-files)\n    - [4. List Files with Specific File Format or Extension](#4-list-files-with-specific-file-format-or-extension)\n    - [5. Delete File](#5-delete-file)\n  - [Database Structure](#database-structure)\n  - [File Categories](#file-categories)\n  - [Flowchart](#flowchart)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Introduction\n\nFlask Simple File Server (FSFS) is a robust and user(admin)-friendly data application developed with Flask. Its primary purpose is to facilitate seamless file management, offering features like file upload, download, and categorization. Built on top of Flask, FSFS ensures a lightweight and efficient solution for organizing and accessing files.\n\n## Features\n\n1. **File Upload and Categorization:** Users can effortlessly upload files through the intuitive web interface. FSFS automatically categorizes files based on their extensions, making it easy to organize and locate them.\n\n2. **File Download:**\n   - standard: Downloading files is straightforward. Users can retrieve files by specifying the filename, and FSFS provides a direct download link for quick access.\n   - enhanced: download endpoints for better user experience, supporting specific files, file formats, extensions, and bulk downloads.\n\n3. **File Listing:** FSFS maintains a detailed list of all uploaded files, including essential information such as filename, extension, category, and upload timestamp. This feature enhances visibility and allows users to review their uploaded content easily.\n\n4. **File Categorization:** Uploaded files are intelligently organized into distinct folders according to their file types. This systematic categorization includes folders for images, videos, audio files, documents, compressed files, XML-related files, and a miscellaneous folder for unrecognized file types.\n\n5. **SQLite Database Integration:** FSFS utilizes an SQLite database (`files.db`) to store and manage file metadata. The database ensures data persistence and enables efficient retrieval of file information.\n\n6. **General Folder:** FSFS now includes a \"GENERAL_FOLDER\" for files with extensions not covered by existing categories.\n\n7. **Delete:** delete specific file using the filename as the value for the `delete` endpoint make it easier to delete unwanted file.\n\n## Installation\n\nSetting up FSFS is a straightforward process. Follow these steps:\n\n1. **Clone the Repository:**\n\n    ```bash\n    git clone https://github.com/1999AZZAR/Flask-Simple-File-Server.git\n    cd Flask-Simple-File-Server\n    ```\n\n2. **Install Dependencies:**\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n3. **Run the Application:**\n\n    ```bash\n    cd code\n    python the_server.py\n    ```\n\n    Access the server at [http://localhost:2500](http://localhost:2500) and [here](instruction.md) for more detailed instructions.\n\n## Usage\n\nFSFS offers a user-friendly experience for managing files. Users can utilize the provided API endpoints to interact with the file server. Refer to the [API Endpoints](#api-endpoints) section for detailed information.\n\n## API Endpoints\n\n### 1. Upload File\n\n**Endpoint:** `/upload`  \n**Method:** `POST`  \n**Parameters:**\n\n- `file`: The file to be uploaded\n- [example](code/example/api-call/file_upload.py)\n\n### 2. Download File\n\n**Endpoint:** `/download`  \n**Method:** `GET`  \n**Parameters:**\n\n- `filename`: The name of the file to be downloaded\n- `fileformat`: The file format for bulk download\n- `extension`: The file extension for bulk download\n- `all`: Download all files\n- usage example `/download?fileformat=Image` will download all image files.\n- [code example](code/example/api-call/file_download.py)\n\n### 3. List Files\n\n**Endpoint:** `/list`  \n**Method:** `GET`  \n**Returns:** JSON array containing details of all uploaded files\n\n- [example](code/example/api-call/file_list.py)\n\n### 4. List Files with Specific File Format or Extension\n\n- To list files of a specific file format, use `/list?fileformat=\u003cyour_file_format\u003e`\n- To list files with a specific extension, use `/list?extension=\u003cyour_extension\u003e`\n\nFor example:\n\n- `/list?fileformat=Image` will list all image files.\n- `/list?extension=.pdf` will list all PDF files.\n\n### 5. Delete File\n\n**Endpoint:** `/delete/\u003cfilename\u003e`  \n**Method:** `DELETE`  \n**Parameters:**\n\n- `filename`: The name of the file to be deleted\n\nUsage example: `/delete/myfile.txt` will delete the file named \"myfile.txt\".\n\n## Database Structure\n\nFSFS employs an SQLite database (`files.db`) with a table named `files` to store file information. The table structure is as follows:\n\n- `filename`: Name of the uploaded file\n- `extension`: File extension\n- `category`: File category (e.g., Image, Video)\n- `upload_time`: Timestamp of when the file was uploaded\n\n## File Categories\n\nFiles are intelligently categorized into the following folders based on their extensions:\n\n- `other_files`: Miscellaneous files\n- `xml_files`: XML-related files\n- `img_files`: Image files\n- `video_files`: Video files\n- `audio_files`: Audio files\n- `document_files`: Document files\n- `compressed_files`: Compressed files\n- `null_files`: Files with no recognizable extension\n- `general_files`: Files with unknown extensions\n\n## Flowchart\n\n[![Flowchart](https://mermaid.ink/img/pako:eNqFlllzokAUhf_KrX7xxaSIcUEeZgrFBfdEs7bzwEBrqBFwGkjFCfnv0zSJUZqlfKA559x7vwYKeUemZxGkoC019i-w0tYugIpvyd-Q-MEvuLj4ES3my1UEHdx9IeYfqGzsHamA7QL9DMUlHZ6ceRF0WXEQUhcqfRYE2-c5mxKrUoW6JJ3En4gfgYYHJIDQJxTiztzWuJ3Mi0XXcEgEPay7r8bOto7aT57ufTfrH4efRiHOnkzvHWEHuEuJERDYeDuLUJ_bg9iGIefi5eQtIK5vey63h9zW8dBwrbi3l_L1Y_c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AxSOsaNQOHrySEKT6M064OcQkzViHc4_0w7RkHK254wNHzVB0IdWZ8ErFVIcz4YfNvYn8CjJiUWcI5E9s_xxr5HSzB4SvmmyOUeTxHYJo8GMLj4Vvw4siZN653bihIGSYRny4hPgnE5wzE53PEl-J6ScTclFES8fUS4qtAfMtAfDtHVJTigknG_JxxElJpXaJUxH8CFDWDU1EToFpx0RRobs4kBapfBNVj0HYWaDsB2ikumgLNzZmmQLsXQeO_l9LLAu0lQPvFRVOguTn3KdDBRdBBDDrMAh0mQEfFRVOguTkPKdDxRdBxDDrJAp0kQKfFRVOguTmPongrWoy3ppxQRF8yo4qSHdayw53scD87PMoOTzPDrcN_I47xpkHaxrf9vvGA-WZNdpFVleIbSB_qc50b5dM2RNzrsDYYf_r7m0SVv9sBtcoPZcUlaB9aC7V6fiRqLW979-62Ya8CFnHenHc3LuUfBA3cuLep8RxURg5hjmFbvKnaRnMskP9BHLJATT60DPZngRbujvuMwKezjWuips8CUkbB2uINgmYbvBdzDsG14b5RevqKmlv0hZqydHN915Abt7Ik3dbr0l0ZbVCzIV9XqtW7iiRznFu5Ut-V0T-RX7luVGtSpcrj9UqjXq-XEbFsn7JR3ACKPnD3HzYiWW4)\n\n## Contributing\n\nContributions to FSFS are highly encouraged. Whether it's bug fixes, feature enhancements, or feedback, your input is valuable. Feel free to open issues or submit pull requests.\n\n## License\n\nFSFS is licensed under the [MIT License](LICENSE). Your usage and contributions are subject to the terms specified in the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fflask-simple-file-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1999azzar%2Fflask-simple-file-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fflask-simple-file-server/lists"}