{"id":22215386,"url":"https://github.com/harishanchu/laravel-ftp","last_synced_at":"2025-05-16T18:06:46.592Z","repository":{"id":13156579,"uuid":"15839320","full_name":"harishanchu/Laravel-FTP","owner":"harishanchu","description":"A simple Laravel 4/5/6/7 ftp service provider with basic ftp methods.","archived":false,"fork":false,"pushed_at":"2020-11-14T00:09:48.000Z","size":59,"stargazers_count":220,"open_issues_count":8,"forks_count":86,"subscribers_count":15,"default_branch":"v2","last_synced_at":"2025-05-16T18:06:42.828Z","etag":null,"topics":["ftp","larvel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"TheMuppets/proprietary_vendor_qcom_binaries","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harishanchu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-12T08:59:14.000Z","updated_at":"2025-03-13T07:40:27.000Z","dependencies_parsed_at":"2022-07-15T13:24:32.677Z","dependency_job_id":null,"html_url":"https://github.com/harishanchu/Laravel-FTP","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harishanchu%2FLaravel-FTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harishanchu%2FLaravel-FTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harishanchu%2FLaravel-FTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harishanchu%2FLaravel-FTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harishanchu","download_url":"https://codeload.github.com/harishanchu/Laravel-FTP/tar.gz/refs/heads/v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582905,"owners_count":22095518,"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":["ftp","larvel"],"created_at":"2024-12-02T21:27:26.801Z","updated_at":"2025-05-16T18:06:46.573Z","avatar_url":"https://github.com/harishanchu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Laravel-FTP\n===========\n\nA simple Laravel 5/6/7 ftp service provider.\n\n[![Latest Stable Version](https://poser.pugx.org/anchu/ftp/v/stable)](https://packagist.org/packages/anchu/ftp)\n[![Build Status](https://travis-ci.org/harishanchu/Laravel-FTP.png?branch=master)](https://travis-ci.org/harishanchu/Laravel-FTP)\n[![Quality](https://codeclimate.com/github/harishanchu/Laravel-FTP/badges/gpa.svg)](https://codeclimate.com/github/harishanchu/Laravel-FTP)\n[![Total Downloads](https://poser.pugx.org/anchu/ftp/downloads)](https://packagist.org/packages/anchu/ftp)\n[![License](https://poser.pugx.org/anchu/ftp/license)](https://packagist.org/packages/anchu/ftp)\n### For Laravel 4.x, check [v1.0.0](https://github.com/harishanchu/Laravel-FTP/tree/v1.0.0)\n\nInstallation\n------------\n\nAdd the package to your `composer.json` and run `composer update`.\n\n    {\n        \"require\": {\n            \"anchu/ftp\": \"~2.0\"\n        }\n    }\n\u003e If you're using Laravel 5.5+ skip the next step, as Laravel auto discover packages.\n\nAdd the service provider in `config/app.php`:\n\n    'Anchu\\Ftp\\FtpServiceProvider',\n\nConfiguration\n------------\nRun `php artisan vendor:publish --tag=config` and modify the config file(`config/ftp.php`) with your ftp connections.\n\nYou can add dynamic FTP connections with following syntax\n\n```php\nConfig::set('ftp.connections.key', array(\n           'host'   =\u003e '',\n           'username' =\u003e '',\n           'password'   =\u003e '',\n           'passive'   =\u003e false,\n           'secure'   =\u003e false,\n));\n```\n\nAccessing connections\n---------------------\nYou can access default FTP connection via the `FTP::connection` method:\n```php\nFTP::connection()-\u003egetDirListing(...);\n```\n\nWhen using multiple connections you can access each specific ftp connection by passing connection name:\n```php\nFTP::connection('foo')-\u003egetDirListing(...);\n```\n\nSometimes you may need to reconnect to a given ftp:\n```php\nFTP::reconnect('foo');\n```\n\nIf you need to disconnect from a given ftp use the disconnect method:\n```php\nFTP::disconnect('foo');\n```\n\nBasic usage examples\n------------\n```php\n// With custom connection\n$listing = FTP::connection('my-ftp-connection')-\u003egetDirListing();\n\n// with default connection\n$listing = FTP::connection()-\u003egetDirListing();\n$status = FTP::connection()-\u003emakeDir('directory-name');\n```\n\nSupported methods\n-----------------\n**getDirListing($directory, $parameters )**\n\nReturns a list of files in the given directory\n\n - `$directory`: The directory to be listed. Default value: `.`.\n - `$parameters`: Optional parameters to prefix with directory. For example: `-la`. Default: `null`.\n\n**getDirListingDetailed($directory)**\n\nReturns a list of files in the given directory as an associative array with the following keys:\nrights, number, user, group, size, month, day and time\n\n - `$directory`: The directory to be listed. Default value: `.`.\n\n**makeDir($directory)**\n\nCreates the specified directory on the FTP server.\n\n - `$directory`: The name of the directory that will be created.\n\n**changeDir($directory)**\n\nChanges the current directory on a FTP server.\n\n - `$directory`: The target directory.\n\n**uploadFile($fileFrom, $fileTo, $mode)**\n\nUploads a local file to the FTP server.\n\n - `$fileFrom`: The local file path.\n - `$fileTo`: The remote file path.\n - `$mode`: The transfer mode. Must be either `FTP_ASCII` or `FTP_BINARY`. Automatic mode resolution will be done if no mode is specified.\n\n**downloadFile($fileFrom, $fileTo, $mode)**\n\nDownloads a file from the FTP server\n\n - `$fileFrom`: The remote file path.\n - `$fileTo`: The local file path (will be overwritten if the file already exists) or an open file pointer in which we store the data.\n - .\n - `$mode`: The transfer mode. Must be either `FTP_ASCII` or `FTP_BINARY`. Automatic mode resolution will be done if no mode is specified.\n\n**readFile($fileFrom)**\n\nSame as the `downloadFile()` method except it downloads the remote file to the PHP output buffer and returns it.\n\n - `$fileFrom`: The remote file path.\n\n**moveUp()**\n\n Changes to the parent directory.\n\n**permission($mode, $filename)**\n\nSet permissions on a file.\n\n - `$mode`: The new permissions, given as an octal value.\n - `$filename`: The remote file.\n\n**delete($path)**\n\nDeletes the file specified by path from the FTP server.\n\n - `$path`: The file to delete.\n\n**currentDir()**\n\nReturns the current directory name\n\n**rename($oldName, $newName)**\n\nRenames a file or a directory on the FTP server.\n\n - `$oldName`: The old file/directory name.\n - `$newName`: The new name.\n\n**removeDir($directory, $recursive)**\n\n Removes a directory\n\n  - `$directory`: The directory to delete. This must be either an absolute or relative path to an empty directory.\n  - `$recursive`: Delete the folder recursively. Default value: false.\n\n**truncateDir($directory)**\n\n Truncates a directory\n\n  - `$directory`: The directory to truncate. This must be either an absolute or relative path to a directory.\n\n**size($remoteFile)**\n\nReturns the size of the given file in bytes.\n`Note: Not all servers support this feature.`\n\n - `$remoteFile`: The remote file.\n\n**time($remoteFile)**\n\nReturns the last modified time of the given file\n`Note: Not all servers support this feature.`\n\n - `$remoteFile`: The remote file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharishanchu%2Flaravel-ftp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharishanchu%2Flaravel-ftp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharishanchu%2Flaravel-ftp/lists"}