PHPackages                             nativephp/mobile-file - 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. nativephp/mobile-file

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

nativephp/mobile-file
=====================

File operations plugin for NativePHP Mobile

1.0.1(1mo ago)2831—0%1MITKotlinPHP ^8.2

Since Jan 19Pushed 1mo agoCompare

[ Source](https://github.com/NativePHP/mobile-file)[ Packagist](https://packagist.org/packages/nativephp/mobile-file)[ RSS](/packages/nativephp-mobile-file/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

File Plugin for NativePHP Mobile
================================

[](#file-plugin-for-nativephp-mobile)

File operations (move, copy) for NativePHP Mobile applications.

Overview
--------

[](#overview)

The File API provides cross-platform file manipulation operations.

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

[](#installation)

```
composer require nativephp/mobile-file
```

Usage
-----

[](#usage)

### PHP (Livewire/Blade)

[](#php-livewireblade)

```
use Native\Mobile\Facades\File;

// Move a file
$result = File::move('/path/to/source.txt', '/path/to/destination.txt');

if ($result['success']) {
    echo 'File moved successfully!';
}

// Copy a file
$result = File::copy('/path/to/source.txt', '/path/to/copy.txt');

if ($result['success']) {
    echo 'File copied successfully!';
}
```

### JavaScript (Vue/React/Inertia)

[](#javascript-vuereactinertia)

```
import { File } from '#nativephp';

// Move a file
const result = await File.move('/path/to/source.txt', '/path/to/destination.txt');

if (result.success) {
    console.log('File moved successfully!');
}

// Copy a file
const result = await File.copy('/path/to/source.txt', '/path/to/copy.txt');

if (result.success) {
    console.log('File copied successfully!');
}
```

Methods
-------

[](#methods)

### `move(string $from, string $to): array`

[](#movestring-from-string-to-array)

Moves a file from source to destination.

ParameterTypeDescription`from`stringSource file path`to`stringDestination file path**Returns:**

- `success: bool` - Whether the operation succeeded
- `error: string` - Error message if operation failed (optional)

### `copy(string $from, string $to): array`

[](#copystring-from-string-to-array)

Copies a file from source to destination.

ParameterTypeDescription`from`stringSource file path`to`stringDestination file path**Returns:**

- `success: bool` - Whether the operation succeeded
- `error: string` - Error message if operation failed (optional)

Behavior
--------

[](#behavior)

- Parent directories are created automatically if they don't exist
- Existing destination files are overwritten
- File integrity is verified after copy operations
- On Android, if rename fails (cross-filesystem), falls back to copy + delete

Examples
--------

[](#examples)

### Move File to Permanent Storage

[](#move-file-to-permanent-storage)

```
use Native\Mobile\Facades\File;

$tempPath = '/var/mobile/Containers/Data/tmp/recording.m4a';
$permanentPath = storage_path('recordings/recording.m4a');

$result = File::move($tempPath, $permanentPath);

if ($result['success']) {
    // File moved successfully
}
```

### Backup File Before Edit

[](#backup-file-before-edit)

```
use Native\Mobile\Facades\File;

public function editFile($filePath)
{
    // Create backup
    $backupPath = str_replace('.txt', '_backup.txt', $filePath);
    File::copy($filePath, $backupPath);

    // Proceed with editing...
}
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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 ~59 days

Total

2

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ab43d3432a80f0f41fe7015280f6024ff13fe8c2306cf114a1fbc91a4cd6f35?d=identicon)[simonhamp](/maintainers/simonhamp)

![](https://www.gravatar.com/avatar/16cc4d562d3f6f302901f1c65eb3ce819c0fb24ab2616241c605126102812ca4?d=identicon)[shanerbaner82](/maintainers/shanerbaner82)

---

Top Contributors

[![shanerbaner82](https://avatars.githubusercontent.com/u/5580860?v=4)](https://github.com/shanerbaner82 "shanerbaner82 (8 commits)")[![simonhamp](https://avatars.githubusercontent.com/u/31628?v=4)](https://github.com/simonhamp "simonhamp (3 commits)")

---

Tags

nativephpnativephp-mobilenativephp-plugin

### Embed Badge

![Health badge](/badges/nativephp-mobile-file/health.svg)

```
[![Health](https://phpackages.com/badges/nativephp-mobile-file/health.svg)](https://phpackages.com/packages/nativephp-mobile-file)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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