{"id":17342793,"url":"https://github.com/inambe/php-file-uploading-class","last_synced_at":"2025-07-20T15:03:18.425Z","repository":{"id":182877401,"uuid":"101193366","full_name":"Inambe/php-file-uploading-class","owner":"Inambe","description":"validate and upload files more easily using php","archived":false,"fork":false,"pushed_at":"2017-09-29T02:30:34.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T09:19:08.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Inambe.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}},"created_at":"2017-08-23T15:02:17.000Z","updated_at":"2019-02-16T12:36:22.000Z","dependencies_parsed_at":"2023-07-22T00:46:30.033Z","dependency_job_id":null,"html_url":"https://github.com/Inambe/php-file-uploading-class","commit_stats":null,"previous_names":["inambe/php-file-uploading-class"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Inambe/php-file-uploading-class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inambe%2Fphp-file-uploading-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inambe%2Fphp-file-uploading-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inambe%2Fphp-file-uploading-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inambe%2Fphp-file-uploading-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inambe","download_url":"https://codeload.github.com/Inambe/php-file-uploading-class/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inambe%2Fphp-file-uploading-class/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143941,"owners_count":23883069,"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":[],"created_at":"2024-10-15T16:07:05.044Z","updated_at":"2025-07-20T15:03:18.402Z","avatar_url":"https://github.com/Inambe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP File Uploading Class\n\nValidate and upload files on server more easily using PHP.\n\n## Getting Started\n\nAll you need to get started with this class is, include or autoload this class into you project/file.\n\n## Simple uploading\n\nWe can start using this class by adding this simple code into your form submiting code block. [ file(containing form) dirctory is default upload directory ]\n\n```\n$a = new Upload(\"input_field_name\");\n$a-\u003edo_upload();\n```\n\n## Set upload directory (optional)\nWe can pass second parameter(string) for defining upload directory. [ Don't forgot the ending slash in directory name ]\n\n```\n$a = new Upload(\"input_field_name\",\"uploaded_files/\");\n$a-\u003edo_upload();\n```\n\n## Maximum file size validation (optional)\n\nWe can add maximum file size(Megabytes) parameter in order to validate file size. [ default=5MB ]\n\n```\n$a = new Upload(\"input_field_name\",\"directory_to_upload/\",10);\n$a-\u003edo_upload();\n```\n\n## File extension validation (optional) \n\nWe can pass an array of allowed extensions to validate file extension. [ default = [\"jpg\",\"png\",\"gif\"] ]\n\n```\n$a = new Upload(\"input_field_name\",\"directory_to_upload/\",10,[\"png\",\"jpg\"]);\n$a-\u003edo_upload();\n```\n## Checking for errors and warnings\n\nwe can use `errors()` method to get array of errors and warnings.\nRemember `do_upload()` will return false if there will be any error or warning. \n\n```\n$a = new Upload(\"input_field_name\",\"directory_to_upload/\",10,[\"png\",\"jpg\"]);\nif($a-\u003edo_upload()){\n  $a-\u003efile_name(); // will return file name\n  $a-\u003efile_url(); // will return file url(current) \n  // file is uploaded do whatever you want to do\n}else{\n  foreach ($a-\u003eerrors() as $error) {\n    echo $error.\"\u003cbr\u003e\";\n  }\n  die();\n}\n```\ncheck test.php for complete working example.\n\n## Authors\n\n* **Inambe** - *Developer* - [Inambe](https://facebook.com/inambe.io)\n* **kamaltech** *Created for* [Kamaltech](http://kamaltech.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finambe%2Fphp-file-uploading-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finambe%2Fphp-file-uploading-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finambe%2Fphp-file-uploading-class/lists"}