codebridge/transfersh

轻松与transfer.sh API交互

1.1 2016-03-29 19:30 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:47:29 UTC


README

安装

composer require codebridge/transfersh

代码示例

use CodeBridge\Transfer;

$transfer_client = new Transfer();

$file_path = realpath('./whatever.ext');
$download_url = $transfer_client->send($file_path);

多个文件

use CodeBridge\Transfer;

$transfer_client = new Transfer();

$file_paths = ['./whatever.ext','./whatever2.ext'];
$download_url = $transfer_client->send($file_paths,'custom_zip_name'); //Returns custom_zip_name.zip

更复杂的示例(用于自托管安装)

use CodeBridge\Transfer;

$transfer_client = new Transfer('http', 'yourdomain.com');

$file_path = realpath('./whatever.ext');
$download_url = $transfer_client->send($file_path, 'somecustomname.ext');