ankitpokhrel / tus-php

🚀 A pure PHP server and client for the tus resumable upload protocol v1.0.0

Home Page:https://tus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update the filename when save file

prabhatjhaba opened this issue · comments

Hi
Can we have a example where we can change the name of the file when it get saved, right it keeps original file name from the request header when it get saved. I do not see any method that can change the file name.

Thanks in advance.

commented

@prabhatjhaba you can use events to update the filename once it get uploaded.

$server->event()->addListener('tus-server.upload.complete', function (\TusPhp\Events\TusEvent $event) {
    $fileMeta = $event->getFile()->details();
     
    // Rename your file here.
});

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

Closing because of inactivity.