PHPackages                             flytachi/winter-s4w-api - 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. flytachi/winter-s4w-api

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

flytachi/winter-s4w-api
=======================

S4W file storage API client for the Winter framework — upload, list, fetch, delete and private streaming proxy.

v1.0.0(yesterday)06↑2900%MITPHPPHP &gt;=8.3

Since Jun 22Pushed yesterdayCompare

[ Source](https://github.com/Flytachi/winter-s4w-api)[ Packagist](https://packagist.org/packages/flytachi/winter-s4w-api)[ Docs](https://winterframe.net)[ RSS](/packages/flytachi-winter-s4w-api/feed)WikiDiscussions main Synced today

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

Winter S4W API
==============

[](#winter-s4w-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cfb75cac3d3fcdfcaab3d31e07b07756c48cc1f6dfaec93a91c1172a9a4350d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c7974616368692f77696e7465722d7334772d6170692e737667)](https://packagist.org/packages/flytachi/winter-s4w-api)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/5c8ce4571ddf4b6b8ca847e0c4c079de98fc6460eb7eae9c81ca63319c21f546/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e332d626c75652e737667)](https://www.php.net)

PHP client for **[S4W](https://github.com/Flytachi/s4w)** — a self-hosted file storage service — built on top of the [Winter Framework](https://winterframe.net)HTTP layer ([flytachi/winter-cast](https://packagist.org/packages/flytachi/winter-cast)).

It wraps the S4W REST API behind a small, typed facade: upload, list, fetch and delete files, build private/public URLs, and **stream private files straight through your backend** to the browser (with HTTP `Range` / seek support) without ever exposing the master token.

```
$file = S4w::fileUpload('/tmp/invoice.pdf', section: 'documents');

$file->id;        // "692320e4-ebaa-49ae-8399-abced0ea44c8"
$file->mime;      // "application/pdf"
$file->isPublic;  // false
```

---

What is S4W?
------------

[](#what-is-s4w)

S4W is a standalone file-storage server (deduplicating object store with public and private access, sections, image compression / WebP conversion).

- **Source:**
- **Docker image:** [`flytachi/s4w`](https://hub.docker.com/r/flytachi/s4w)

```
docker run -d --name s4w -p 9090:80 flytachi/s4w
```

This package is the **client**; it talks to a running S4W instance over HTTP.

---

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- `ext-curl`
- [flytachi/winter-cast](https://packagist.org/packages/flytachi/winter-cast) ^1.0
- A reachable S4W instance + its API token

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

[](#installation)

```
composer require flytachi/winter-s4w-api
```

---

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

[](#configuration)

The package ships an **abstract** base class, `S4wBaseApi`. You create one concrete subclass that supplies the connection details. This keeps credentials in your app (env, config, secrets manager) and lets you have multiple S4W connections if needed.

```
