{"id":16461915,"url":"https://github.com/milwad-dev/filei","last_synced_at":"2025-03-23T10:33:47.970Z","repository":{"id":257792623,"uuid":"839198835","full_name":"milwad-dev/filei","owner":"milwad-dev","description":"A golang file uploader package.","archived":false,"fork":false,"pushed_at":"2024-11-01T15:20:32.000Z","size":42,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T19:54:19.836Z","etag":null,"topics":["file","file-uploader","filei","go","go-file","go-library","go-package","golang","uploader"],"latest_commit_sha":null,"homepage":"","language":"Go","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/milwad-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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-08-07T06:31:32.000Z","updated_at":"2025-02-12T10:04:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"37491878-63c9-4f53-a13f-84a784bfae6b","html_url":"https://github.com/milwad-dev/filei","commit_stats":null,"previous_names":["milwad-dev/filei"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milwad-dev%2Ffilei","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milwad-dev%2Ffilei/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milwad-dev%2Ffilei/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milwad-dev%2Ffilei/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milwad-dev","download_url":"https://codeload.github.com/milwad-dev/filei/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090880,"owners_count":20559296,"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":["file","file-uploader","filei","go","go-file","go-library","go-package","golang","uploader"],"created_at":"2024-10-11T11:09:50.998Z","updated_at":"2025-03-23T10:33:47.960Z","avatar_url":"https://github.com/milwad-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileI\n\nThe `FileI` is a lightweight and easy-to-use package for handling file operations in Go (Golang). It simplifies common file-related tasks such as uploading, deleting, and managing files, allowing developers to handle file I/O operations with minimal effort. Whether you're building an API, managing assets, or simply need a streamlined way to work with files in Go, FileI provides intuitive methods that integrate seamlessly into your project.\n\n[![GoDoc Widget](https://godoc.org/github.com/milwad-devi/filei?status.svg)](https://pkg.go.dev/github.com/milwad-dev/filei)\n[![Passed Tests](https://github.com/milwad-dev/filei/actions/workflows/tests.yml/badge.svg)](https://github.com/milwad-dev/filei/actions/workflows/tests.yml)\n\nKey Features:\n\n- File Upload: Easily upload files with minimal configuration.\n- File Deletion: Remove files from your system with a single function call.\n- Error Handling: Provides built-in error handling for common file operations.\n- Cross-platform Support: Works across different operating systems.\n\nPerfect for developers who need to manage file operations quickly and efficiently in their Go projects.\n\n## Installation\n\nFor install the `FileI` on your project, you can run below command on terminal:\n\n```shell\ngo get -u github.com/milwad-dev/filei\n```\n\n## Usage\n\n- [UploadFile](#upload-file)\n- [GetFile](#get-file)\n- [DeleteFile](#delete-file)\n- [CreateFile](#create-file)\n- [Exists](#exists)\n- [CleanDirectory](#clean-directory)\n- [DeleteDirectory](#delete-directory)\n- [MoveFile](#move-file)\n- [Files](#files)\n- [Size](#size)\n- [Chmod](#chmod)\n- [Prepend](#prepend)\n- [Append](#append)\n\n\u003ca name=\"upload-file\"\u003e\u003c/a\u003e\n### UploadFile\n\nIf you want to upload a file to a path you can use `UploadFile` function:\n\n```go\nfile, _ := os.Create(\"testdata/new-text.txt\")\n\nerr := UploadFile(file, \"destPath\")\nif err != nil {\n    // ...\n}\n```\n\n\u003ca name=\"get-file\"\u003e\u003c/a\u003e\n### GetFile\n\nIf you want to retrieve a file from the specified path, you can use `GetFile` function:\n\n```go\nfile, err := GetFile(\"file path\")\nif err != nil {\n\t// ...\n}\n```\n\n\u003ca name=\"delete-file\"\u003e\u003c/a\u003e\n### DeleteFile\n\nIf you want to delete a file, you can use `DeleteFile` function:\n\n```go\nerr := DeleteFile(\"file path\")\nif err != nil {\n    // ...\n}\n```\n\n\u003ca name=\"create-file\"\u003e\u003c/a\u003e\n### CreateFile\n\nIf you want to create a file with specific extension and contains a data, you can use `CreateFile` function:\n\n```go\ndata := []byte(\"milwad\")\n\nerr := CreateFile(\"file path\", data)\nif err != nil {\n    // ...\n}\n```\n\n\u003ca name=\"exists\"\u003e\u003c/a\u003e\n### Exists\n\nIf you want to ensure that a file exists, you can use `Exists` function:\n\n```go\nisExists := Exists(\"file path\") // Bool\n```\n\n\u003ca name=\"clean-directory\"\u003e\u003c/a\u003e\n### CleanDirectory\n\nIf you want to clean a directory (remove all files in a directory), you can use `CleanDirectory` function:\n\n```go\nCleanDirectory(\"directory path\") // Bool\n```\n\n\u003ca name=\"delete-directory\"\u003e\u003c/a\u003e\n### DeleteDirectory\n\nIf you want to delete a directory, you can use `DeleteDirectory` function:\n\n```go\nerr := DeleteDirectory(directory)\n```\n\n\u003ca name=\"move-directory\"\u003e\u003c/a\u003e\n### MoveDirectory\n\nIf you want to move a directory to another path, you can use `MoveDirectory` function:\n\n```go\nerr := MoveFile(sourcePath, destPath)\n```\n\n\u003ca name=\"files\"\u003e\u003c/a\u003e\n### Files\n\nIf you want to get all files of a directory, you can use `Files` function:\n\n```go\nfiles, err := Files(directory)\n```\n\n\u003ca name=\"size\"\u003e\u003c/a\u003e\n### Size\n\nIf you want to get a size of a file, you can use `Size` function:\n\n```go\nsize, err := Size(filePath)\n```\n\n\u003ca name=\"chmod\"\u003e\u003c/a\u003e\n### Chmod\n\nIf you want to give permission to a file, you can use `Chmod` function:\n\n```go\nerr := Chmod(filePath, 0700)\n```\n\n\u003ca name=\"prepend\"\u003e\u003c/a\u003e\n### Prepend\n\nIf you want to write to the beginning of a file, you can use `Prepend` function:\n\n```go\nerr := Prepend(filePath, data)\n```\n\n\u003ca name=\"append\"\u003e\u003c/a\u003e\n# Append\n\nIf you want to write to the end of a file, you can use `Append` function:\n\n```go\nerr := Append(filePath, data)\n```\n\n## License\n\n* This package is created and modified by \u003ca href=\"https://github.com/milwad-dev\" target=\"_blank\"\u003eMilwad Khosravi\u003c/a\u003e for Laravel upper more than 9 and has been released under the MIT License.\n\n## Contributing\n\nThis project exists thanks to all the people who contribute. [CONTRIBUTING](https://github.com/milwad-dev/filei/graphs/contributors)\n\n\u003ca href=\"https://github.com/milwad-dev/filei/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/filei/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n## Security\n\nIf you've found a bug regarding security please mail [milwad.dev@gmail.com](mailto:milwad.dev@gmail.com) instead of using the issue tracker.\n\n\n## Donate\n\nIf this package is helpful for you, you can buy a coffee for me :) ❤️\n\n- Iraninan Gateway: https://daramet.com/milwad_khosravi\n- Paypal Gateway: SOON\n- MetaMask Address: `0xf208a562c5a93DEf8450b656c3dbc1d0a53BDE58`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilwad-dev%2Ffilei","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilwad-dev%2Ffilei","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilwad-dev%2Ffilei/lists"}