PHPackages                             bitw/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bitw/laravel-ftp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bitw/laravel-ftp
================

A simple Laravel 7+ ftp service provider

2.0.5(4y ago)010.9k↑56.4%MITPHPPHP &gt;=7.1

Since Sep 24Pushed 4y agoCompare

[ Source](https://github.com/bitw/Laravel-FTP)[ Packagist](https://packagist.org/packages/bitw/laravel-ftp)[ RSS](/packages/bitw-laravel-ftp/feed)WikiDiscussions v2 Synced 2d ago

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

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

[](#laravel-ftp)

A simple Laravel 5/6/7/8 ftp service provider.

[![Latest Stable Version](https://camo.githubusercontent.com/08eddc9fb48fb4059b031130f30fc5d0338c54718cb4c75b63dc5a68a98ea6ae/68747470733a2f2f706f7365722e707567782e6f72672f616e6368752f6674702f762f737461626c65)](https://packagist.org/packages/anchu/ftp)[![Build Status](https://camo.githubusercontent.com/4da9e28e1a86302f786c3c1db71d4f76fb5e899a8359f46536916dcd43be2cdc/68747470733a2f2f7472617669732d63692e6f72672f686172697368616e6368752f4c61726176656c2d4654502e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/harishanchu/Laravel-FTP)[![Quality](https://camo.githubusercontent.com/4e596b7b83eb9652f7b83db3733bf1331afd2f9300ca9e6110237134d51571d5/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f686172697368616e6368752f4c61726176656c2d4654502f6261646765732f6770612e737667)](https://codeclimate.com/github/harishanchu/Laravel-FTP)[![Total Downloads](https://camo.githubusercontent.com/08f53dcaa11ce3bdba485b3c4c69f8cef2a0e2a9124a4d73309833180f5a58d5/68747470733a2f2f706f7365722e707567782e6f72672f616e6368752f6674702f646f776e6c6f616473)](https://packagist.org/packages/anchu/ftp)[![License](https://camo.githubusercontent.com/9bf7270602665c1eecd7716f4f6fafc4e55f4e856ba7efc396598760cd58b99e/68747470733a2f2f706f7365722e707567782e6f72672f616e6368752f6674702f6c6963656e7365)](https://packagist.org/packages/anchu/ftp)

### For Laravel 4.x, check [v1.0.0](https://github.com/harishanchu/Laravel-FTP/tree/v1.0.0)

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

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

[](#installation)

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

```
{
    "require": {
        "jilfond/laravel-ftp": "~2.0"
    }
}

```

> If you're using Laravel 5.5+ skip the next step, as Laravel auto discover packages.

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

```
'Anchu\Ftp\FtpServiceProvider',

```

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

[](#configuration)

Run `php artisan vendor:publish --tag=config` 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,
           'secure'   => 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

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 68.4% 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

Every ~257 days

Recently: every ~272 days

Total

11

Last Release

1724d ago

Major Versions

v0.0.1 → v1.0.02015-03-22

v1.0.0 → v2.0.02015-03-22

v1.x-dev → v2.0.32020-10-24

PHP version history (3 changes)v0.0.1PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.4.0

2.0.5PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/662422?v=4)[Andrew](/maintainers/bitw)[@bitw](https://github.com/bitw)

---

Top Contributors

[![harishanchu](https://avatars.githubusercontent.com/u/2888759?v=4)](https://github.com/harishanchu "harishanchu (54 commits)")[![yamenarahman](https://avatars.githubusercontent.com/u/24607365?v=4)](https://github.com/yamenarahman "yamenarahman (8 commits)")[![bitw](https://avatars.githubusercontent.com/u/662422?v=4)](https://github.com/bitw "bitw (3 commits)")[![phazei](https://avatars.githubusercontent.com/u/431395?v=4)](https://github.com/phazei "phazei (3 commits)")[![yahoo-ptz](https://avatars.githubusercontent.com/u/2085725?v=4)](https://github.com/yahoo-ptz "yahoo-ptz (3 commits)")[![tomas-novotny](https://avatars.githubusercontent.com/u/36948723?v=4)](https://github.com/tomas-novotny "tomas-novotny (2 commits)")[![tufanbarisyildirim](https://avatars.githubusercontent.com/u/980848?v=4)](https://github.com/tufanbarisyildirim "tufanbarisyildirim (2 commits)")[![EduardBess](https://avatars.githubusercontent.com/u/4729526?v=4)](https://github.com/EduardBess "EduardBess (1 commits)")[![Zwaen91](https://avatars.githubusercontent.com/u/7441106?v=4)](https://github.com/Zwaen91 "Zwaen91 (1 commits)")[![lsowen](https://avatars.githubusercontent.com/u/1014577?v=4)](https://github.com/lsowen "lsowen (1 commits)")[![mnabialek](https://avatars.githubusercontent.com/u/7656807?v=4)](https://github.com/mnabialek "mnabialek (1 commits)")

---

Tags

ftplaravelservice providerl5l6l7

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[anchu/ftp

A simple Laravel 7 ftp service provider

225584.1k1](/packages/anchu-ftp)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[misterphilip/maintenance-mode

An enhanced drop-in replacement for Laravel's maintenance mode

120178.0k](/packages/misterphilip-maintenance-mode)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)

PHPackages © 2026

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