{"id":22209615,"url":"https://github.com/gamepowerx/kekuploadlibrary","last_synced_at":"2026-04-17T05:31:02.240Z","repository":{"id":45973299,"uuid":"465348351","full_name":"GamePowerX/KekUploadLibrary","owner":"GamePowerX","description":"A simple C# Library for UploadServer","archived":false,"fork":false,"pushed_at":"2024-01-24T21:01:07.000Z","size":149,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T04:52:22.709Z","etag":null,"topics":["csharp","dotnet","library","net6","nuget-package","uploadclient"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/CraftingDragon007.KekUploadLibrary/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GamePowerX.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-03-02T14:51:38.000Z","updated_at":"2024-01-26T08:49:33.000Z","dependencies_parsed_at":"2024-12-02T19:44:41.402Z","dependency_job_id":"802f852c-5585-4dee-882c-7d7b0b6b0740","html_url":"https://github.com/GamePowerX/KekUploadLibrary","commit_stats":null,"previous_names":["gamepowerx/kekuploadlibrary"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GamePowerX%2FKekUploadLibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GamePowerX%2FKekUploadLibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GamePowerX%2FKekUploadLibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GamePowerX%2FKekUploadLibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GamePowerX","download_url":"https://codeload.github.com/GamePowerX/KekUploadLibrary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245401398,"owners_count":20609167,"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":["csharp","dotnet","library","net6","nuget-package","uploadclient"],"created_at":"2024-12-02T19:36:07.685Z","updated_at":"2026-02-13T12:21:20.819Z","avatar_url":"https://github.com/GamePowerX.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"KekUploadLibrary [![License](https://shields.io/github/license/CraftingDragon007/KekUploadLibrary)](https://github.com/CraftingDragon007/KekUploadLibrary/blob/master/LICENSE) [![Nuget](https://img.shields.io/nuget/v/CraftingDragon007.KekUploadLibrary)](https://www.nuget.org/packages/CraftingDragon007.KekUploadLibrary) [![Nuget](https://img.shields.io/nuget/dt/CraftingDragon007.KekUploadLibrary)](https://www.nuget.org/packages/CraftingDragon007.KekUploadLibrary)\n====\n\nA simple C# Library for [UploadServer](https://github.com/KotwOSS/kekupload-server)\n\n# Installation\n\nYou can install this Library via NuGet:\n\n```\nPM\u003e Install-Package CraftingDragon007.KekUploadLibrary\n```\n\n# Usage\n\nUsing the upload client:\n\n```C#\nusing System;\nusing System.IO;\nusing KekUploadLibrary;\n\nclass Program\n{\n    static void Main(string[] args)\n\t{\n\t    var client = new UploadClient(\"\u003cYour UploadServer URL\u003e\", \u003cIf you want to also upload the filenames\u003e);\n\t    // Diffrent Events are available (Optional)\n\t    client.UploadCompleteEvent += (sender, e) =\u003e Console.WriteLine(\"Upload Complete: \" + e.FileUrl);\n\t    client.UploadChunkCompleteEvent += (sender, e) =\u003e Console.WriteLine(\"Upload progress: {0}/{1}\", e.CurrentChunkCount, e.TotalChunkCount);\n\t    client.UploadErrorEvent += (sender, e) =\u003e \n\t    {\n\t        if(e.ErrorResponse != null)\n\t        {\n\t            Console.WriteLine(\"Error: \" + e.ErrorResponse);\n\t            Console.WriteLine(\"Exception: \" + e.Exception);\n\t        }else\n\t        {\n\t            Console.WriteLine(\"Error: \" + e.Exception);\n\t        }\n\t    };\n\t    client.UploadStreamCreateEvent += (sender, e) =\u003e Console.WriteLine(\"Upload Stream created: \" + e.UploadStreamId);\n\t    // Upload a file\n\t    client.Upload(new UploadItem(\"\u003cYour File Path\u003e\"), \u003cOptional Cancellation Token\u003e, \u003cOptional wheter or not to use WebSockets for file uploading\u003e);\n\t    // Upload a stream\n\t    using(var stream = new FileStream(\"\u003cFilePath\u003e\", FileMode.Open))\n\t    {\n\t        client.Upload(new UploadItem(stream, \"\u003cExtension\u003e\", \"\u003cFilename\u003e\")); // the filename is optional and must not contain the extension\n\t    }\n\t    // Upload a byte array\n\t    client.Upload(new UploadItem(File.ReadAllBytes(\"\u003cFilePath\u003e\"), \"\u003cExtension\u003e\", \"\u003cFilename\u003e\")); // the filename is optional and must not contain the extension\n\t    // The upload method returns the download url of the uploaded file\n\t}\n}\n```\n\nUsing the chunked upload stream:\n\n```C#\nusing System;\nusing System.IO;\nusing KekUploadLibrary;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        var stream = new ChunkedUploadStream(\"\u003cExtension\u003e\", \"\u003cYour UploadServer URL\u003e\", \"\u003cFilename\u003e\"); // the filname can be null and must not contain the extension\n        // Diffrent Events are available (Optional)\n        stream.UploadChunkCompleteEvent += (sender, e) =\u003e Console.WriteLine(\"Upload progress: {0}/{1}\", e.CurrentChunkCount, e.TotalChunkCount);\n        stream.UploadCompleteEvent += (sender, e) =\u003e Console.WriteLine(\"Upload Complete: \" + e.FileUrl);\n        stream.UploadErrorEvent += (sender, e) =\u003e \n        {\n            if(eventArgs.ErrorResponse != null)\n            {\n                Console.WriteLine(\"Error: \" + e.ErrorResponse);\n                Console.WriteLine(\"Exception: \" + e.Exception);\n            }else\n            {\n                Console.WriteLine(\"Error: \" + e.Exception);\n            }\n        };\n        stream.UploadStreamCreateEvent += (sender, e) =\u003e Console.WriteLine(\"Upload Stream created: \" + e.UploadStreamId);\n        // Now you can write everything you want to the stream\n        // The stream will be chunked and uploaded to the upload server\n        // It will only be uploaded, when you flush the stream\n        stream.Write(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 0, 10);\n        stream.Flush();\n        // You can do this as often as you want\n        stream.Write(new byte[] { 2, 5, 3, 4, 5, 0, 7, 8, 4, 10 }, 0, 10);\n        stream.Flush();\n        // When you are done, you can finish the upload with a final request\n        stream.FinishUpload(); // This returns the download url of the uploaded bytes\n        // Then you can dispose the stream\n        stream.Dispose();\n    }\n}\n```\n\nDownloading a file:\n\n```C#\nusing System;\nusing KekUploadLibrary;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        var downloadClient = new DownloadClient();\n        downloadClient.ProgressChangedEvent += (totalFileSize, totalBytesDownloaded, progressPercentage) =\u003e\n        {\n            Console.WriteLine($\"Total file size: {totalFileSize}\");\n            Console.WriteLine($\"Total bytes downloaded: {totalBytesDownloaded}\");\n            Console.WriteLine($\"Progress percentage: {progressPercentage}\");\n        };\n        downloadClient.Download(\"\u003cYour download url\u003e\", new DownloadItem(\"\u003cYour path\u003e\"));\n    }\n}\n```\n\n\n# License\n\nThis Library is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)\n\n# Contributing\n\nIf you want to contribute to this Library, please open an issue or pull request on GitHub.\n\n# Contributors\n\n- [CraftingDragon007](https://github.com/CraftingDragon007)\n- [KekOnTheWorld](https://github.com/KekOnTheWorld)\n\n# Contact\n\n[Email](mailto:craftingdragon007@outlook.com)\n\u003cbr\u003e\nDiscord: CraftingDragon007#9504","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamepowerx%2Fkekuploadlibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamepowerx%2Fkekuploadlibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamepowerx%2Fkekuploadlibrary/lists"}