PHPackages                             jackyliu/ftp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. jackyliu/ftp

ActiveLibrary[File &amp; Storage](/categories/file-storage)

jackyliu/ftp
============

Wannabe successor of anchu/ftp package for Laravel

0.0.1(3y ago)01771MITPHP

Since Aug 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/JackyLiuZJ/Laravel-FTP)[ Packagist](https://packagist.org/packages/jackyliu/ftp)[ RSS](/packages/jackyliu-ftp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel-FTP
===========

[](#laravel-ftp)

A simple Laravel 8 ftp service provider.

### For Laravel 8.x, check \[v1.0.0\]

[](#for-laravel-8x-check-v100)

Installation
------------

[](#installation)

Add the package to your `composer.json` and run `composer update`.

```
{
    "require": {
        "JackyLiu/ftp": "~1.0"
    }
}

```

Add the service provider in `config/app.php`:

```
'JackyLiu\Ftp\FtpServiceProvider',

```

Configuration
-------------

[](#configuration)

Run `php artisan vendor:publish` and modify the config file(`config/ftp.php`) with your ftp connections.

You can add dynamic FTP connections with following syntax

```
Config::set('ftp.connections.key', array(
           'host'   => '',
           'username' => '',
           'password'   => '',
           'passive'   => false,
));
```

Accessing connections
---------------------

[](#accessing-connections)

You can access default FTP connection via the `FTP::connection` method:

```
FTP::connection()->getDirListing(...);
```

When using multiple connections you can access each specific ftp connection by passing connection name:

```
FTP::connection('foo')->getDirListing(...);
```

Sometimes you may need to reconnect to a given ftp:

```
FTP::reconnect('foo');
```

If you need to disconnect from a given ftp use the disconnect method:

```
FTP::disconnect('foo');
```

Basic usage examples
--------------------

[](#basic-usage-examples)

```
// With custom connection
$listing = FTP::connection('my-ftp-connection')->getDirListing();

// with default connection
$listing = FTP::connection()->getDirListing();
$status = FTP::connection()->makeDir('directory-name');
```

Supported methods
-----------------

[](#supported-methods)

**getDirListing($directory, $parameters )**

Returns a list of files in the given directory

- `$directory`: The directory to be listed. Default value: `.`.
- `$parameters`: Optional parameters to prefix with directory. For example: `-la`. Default: `null`.

**getDirListingDetailed($directory)**

Returns a list of files in the given directory as an associative array with the following keys: rights, number, user, group, size, month, day and time

- `$directory`: The directory to be listed. Default value: `.`.

**makeDir($directory)**

Creates the specified directory on the FTP server.

- `$directory`: The name of the directory that will be created.

**changeDir($directory)**

Changes the current directory on a FTP server.

- `$directory`: The target directory.

**uploadFile($fileFrom, $fileTo, $mode)**

Uploads a local file to the FTP server.

- `$fileFrom`: The local file path.
- `$fileTo`: The remote file path.
- `$mode`: The transfer mode. Must be either `FTP_ASCII` or `FTP_BINARY`. Automatic mode resolution will be done if no mode is specified.

**downloadFile($fileFrom, $fileTo, $mode)**

Downloads a file from the FTP server

- `$fileFrom`: The remote file path.
- `$fileTo`: The local file path (will be overwritten if the file already exists) or an open file pointer in which we store the data.
- .
- `$mode`: The transfer mode. Must be either `FTP_ASCII` or `FTP_BINARY`. Automatic mode resolution will be done if no mode is specified.

**readFile($fileFrom)**

Same as the `downloadFile()` method except it downloads the remote file to the PHP output buffer and returns it.

- `$fileFrom`: The remote file path.

**moveUp()**

Changes to the parent directory.

**permission($mode, $filename)**

Set permissions on a file.

- `$mode`: The new permissions, given as an octal value.
- `$filename`: The remote file.

**delete($path)**

Deletes the file specified by path from the FTP server.

- `$path`: The file to delete.

**currentDir()**

Returns the current directory name

**rename($oldName, $newName)**

Renames a file or a directory on the FTP server.

- `$oldName`: The old file/directory name.
- `$newName`: The new name.

**removeDir($directory, $recursive)**

Removes a directory

- `$directory`: The directory to delete. This must be either an absolute or relative path to an empty directory.
- `$recursive`: Delete the folder recursively. Default value: false.

**truncateDir($directory)**

Truncates a directory

- `$directory`: The directory to truncate. This must be either an absolute or relative path to a directory.

**size($remoteFile)**

Returns the size of the given file in bytes. `Note: Not all servers support this feature.`

- `$remoteFile`: The remote file.

**time($remoteFile)**

Returns the last modified time of the given file `Note: Not all servers support this feature.`

- `$remoteFile`: The remote file.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1384d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b6dfd2f0f20125bcf410bbad68ad5dfb5864ca3a93b90bad2cf0db38ad96bfb?d=identicon)[JackyLiuZJ](/maintainers/JackyLiuZJ)

---

Top Contributors

[![RuleMakersLiu](https://avatars.githubusercontent.com/u/116551687?v=4)](https://github.com/RuleMakersLiu "RuleMakersLiu (16 commits)")

### Embed Badge

![Health badge](/badges/jackyliu-ftp/health.svg)

```
[![Health](https://phpackages.com/badges/jackyliu-ftp/health.svg)](https://phpackages.com/packages/jackyliu-ftp)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4633.7M3](/packages/stechstudio-laravel-zipstream)[spatie/laravel-google-cloud-storage

Google Cloud Storage filesystem driver for Laravel

2408.9M13](/packages/spatie-laravel-google-cloud-storage)[azure-oss/storage-blob-laravel

Azure Storage Blob filesystem driver for Laravel

63582.2k1](/packages/azure-oss-storage-blob-laravel)[spatie/laravel-backup-server

Backup multiple applications

17016.7k1](/packages/spatie-laravel-backup-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
