DEV Community

Discussion on: Resumable file upload in PHP: Handle large file uploads in an elegant way

Collapse
 
konsole profile image
Konsole

Hi @ohffs ,

Thank you for trying the package.

If you are using both tus-php client and server you can provide file name in client itself. For eg:

$client->setKey($uploadKey)->file('/path/to/file', 'my-awesome-file.mp4');

If you want to do it in server side you can do it using hooks which is coming soon in new version: github.com/ankitpokhrel/tus-php/pu...

$server->event()->addListener(
    'tus-server.upload.complete',
     function (\TusPhp\Events\TusEvent $event) {
        // Perform post upload operation.
        // For instance, renaming a file in your case
    });

Hope that address your issue. Feel free to open issue in case you need any help.

Collapse
 
ohffs profile image
ohffs

Oh - thanks for that! Sadly I'd be using the Golang server (embedded device so no PHP) - but I see now it has hooks too so I might be able work something out :-). Thanks for the tip! :-D