{"id":37003631,"url":"https://github.com/ipunkt/fileproxy-client","last_synced_at":"2026-01-14T00:34:22.090Z","repository":{"id":56993235,"uuid":"90226850","full_name":"ipunkt/fileproxy-client","owner":"ipunkt","description":"A client library for fileproxy","archived":true,"fork":false,"pushed_at":"2018-05-24T14:50:48.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T18:05:37.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipunkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-04T05:57:01.000Z","updated_at":"2023-05-30T09:04:18.000Z","dependencies_parsed_at":"2022-08-21T12:50:54.042Z","dependency_job_id":null,"html_url":"https://github.com/ipunkt/fileproxy-client","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ipunkt/fileproxy-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Ffileproxy-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Ffileproxy-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Ffileproxy-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Ffileproxy-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipunkt","download_url":"https://codeload.github.com/ipunkt/fileproxy-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Ffileproxy-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T00:34:21.401Z","updated_at":"2026-01-14T00:34:22.059Z","avatar_url":"https://github.com/ipunkt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fileproxy-client\n\n[![Latest Stable Version](https://poser.pugx.org/ipunkt/fileproxy-client/v/stable.svg)](https://packagist.org/packages/ipunkt/fileproxy-client) [![Latest Unstable Version](https://poser.pugx.org/ipunkt/fileproxy-client/v/unstable.svg)](https://packagist.org/packages/ipunkt/fileproxy-client) [![License](https://poser.pugx.org/ipunkt/fileproxy-client/license.svg)](https://packagist.org/packages/ipunkt/fileproxy-client) [![Total Downloads](https://poser.pugx.org/ipunkt/fileproxy-client/downloads.svg)](https://packagist.org/packages/ipunkt/fileproxy-client)\n\nA client library for fileproxy\n\n## Quickstart\n\n```\ncomposer require ipunkt/fileproxy-client\n```\n\n## Usage\n\nSetting up our client.\n\n```php\n$client = new \\Guzzle\\Http\\Client();\n\n$fileproxy = new \\Ipunkt\\Fileproxy\\FileproxyClient('https://file-proxy.app', $client);\n```\n\n### Setting Credentials\n\nSince version 1.1.0 the fileproxy has the ability to protect api calls with a secret token header. You can add that to the client like so\n \n```php\n$fileproxy-\u003esetCredentials('S3cr3T');\n```\n \nOr, you can configure another header name than the default one:\n```php\n$fileproxy-\u003esetCredentials('S3cr3T', 'X-ANOTHER-SECURITY-TOKEN-NAME');\n```\n\n### Setting Headers\n\nAnother security level can be added by adding custom http headers for each request. So your infrastructure can verify the request by parsing them. You can achieve this like so:\n\n```php\n$fileproxy-\u003eaddHeader('X-HEADER', 'custom value');\n```\n\n\n### Files resource\n\nFiles resource handles all stuff with the related proxy files. These files are the source for the aliases provided by the service.\n\n#### Uploading a new file\n\n```php\n$fileToUpload = new \\SplFileInfo('/absolute/file/path.ext');\n\n/** @var \\Ipunkt\\Fileproxy\\Entities\\File $file */\n$file = $fileproxy-\u003efiles()-\u003estore($fileToUpload);\n```\n\n`$file` is a File entity with the main information about the file itself - the reference.\n\n#### Updating an uploaded file\n\n```php\n$reference = 'UUID-FROM-LOCAL-STORAGE';\n$fileToUpload = new \\SplFileInfo('/absolute/file/path.ext');\n\n/** @var \\Ipunkt\\Fileproxy\\Entities\\File $file */\n$file = $fileproxy-\u003efiles()-\u003eupdate($reference, $fileToUpload);\n```\n\n`$file` is a File entity with the main information about the file itself - the reference.\n\n\n#### Storing a remote file\n\n```php\n$url = 'https://domain.tld/images/picture.jpg';\n\n/** @var \\Ipunkt\\Fileproxy\\Entities\\File $file */\n$file = $fileproxy-\u003efiles()-\u003estoreRemote($url);\n```\n\n`$file` is a File entity with the main information about the file itself - the reference.\n\n#### Updating a stored remote file\n\n```php\n$reference = 'UUID-FROM-LOCAL-STORAGE';\n$url = 'https://domain.tld/images/picture.jpg';\n\n/** @var \\Ipunkt\\Fileproxy\\Entities\\File $file */\n$file = $fileproxy-\u003efiles()-\u003eupdateRemote($reference, $url);\n```\n\n`$file` is a File entity with the main information about the file itself - the reference.\n\n#### Requesting a file by reference\n\n```php\n/** @var \\Ipunkt\\Fileproxy\\Entities\\File $file */\n$file = $fileproxy-\u003efiles()-\u003eget($reference);// $reference is a UUID4\n```\n\n`$file` is a File entity. You can fetch the hits from it for example.\n\n### FileAlias resource\n\nYou can create or retrieve aliases with this resource.\n\n#### Creating an alias\n\n```php\n/** @var \\Ipunkt\\Fileproxy\\Entities\\Alias $alias */\n$alias = $fileproxy-\u003efileAliases($reference /* only once needed */)-\u003ecreate('limited-file.jpg', 5 /* hits only */);// $reference is a UUID4\n```\nThe created `$alias` will be returned and includes the download url and the alias id.\n\n#### Fetching all aliases\n\n```php\n/** @var \\Ipunkt\\Fileproxy\\Entities\\Alias[]|array $aliases */\n$aliases = $fileproxy-\u003efileAliases($reference /* only once needed */)-\u003eall();// $reference is a UUID4\n```\nYou can iterate over all existing `$aliases`.\n\n\n### Alias resource\n\nAlias resource handles requesting and deleting of aliases.\n\n#### Requesting an alias\n\n```php\n/** @var \\Ipunkt\\Fileproxy\\Entities\\Alias $alias */\n$alias = $fileproxy-\u003ealias()-\u003eget($aliasId);// $aliasId = \"${reference}.${alias}\"\n```\n`$alias` is an Alias entity. The main information about an alias is the download url and the hits and hits left statistics data.\n\n#### Deleting an alias\n\n```php\n$fileproxy-\u003ealias()-\u003edelete($aliasId);// $aliasId = \"${reference}.${alias}\"\n```\n\nAlias was deleted when no exception was thrown.\n\n### Statistics resource\n\n#### Requesting statistics\n\n```php\n/** @var \\Ipunkt\\Fileproxy\\Entities\\Statistic $stats */\n$stats = $fileproxy-\u003estatistics()-\u003estats();\n```\n\n`$stats` returns the main statistics for the current service: size in bytes, file and alias count serving and hits summarized.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipunkt%2Ffileproxy-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipunkt%2Ffileproxy-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipunkt%2Ffileproxy-client/lists"}