-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving files into sub folders #79
Comments
@shravanthanvi You can change <?php
require __DIR__ . '/../vendor/autoload.php';
$server = new \TusPhp\Tus\Server('redis');
if (strtolower($server->getRequest()->method()) === 'post') {
$baseDir = __DIR__ . '/../uploads/';
$uploadPath = $baseDir . $server->getUploadKey();
if ( ! is_dir($uploadPath)) {
mkdir($uploadPath);
}
$server->setUploadDir($uploadPath);
}
$response = $server->serve();
$response->send();
exit(0); // Exit from current PHP process. |
Thank you will try it and let you know |
As a uppy.js user, I send a path along with the upload request and placing the file wherever I want: if (strtolower($server->getRequest()->method()) === 'post') {
$upload_path = MEDIA_ROOT . $server->getRequest()->extractMeta('folder');
mkdir($upload_path, 0770, true);
$server->setUploadDir($upload_path);
} |
This does not work with the chunked upload example. Your upload folder is left with just three chunks, the original file does not get reassembled |
Hi
Want to have an example in php where in want to save the files into the subfolder based on key generated
The text was updated successfully, but these errors were encountered: