kukhariev / ngx-uploadx

Angular Resumable Upload Module
https://github.com/kukhariev/ngx-uploadx
MIT License
43 stars 23 forks source link

why not use real filename for completed uploading #352

Closed ajeecai closed 2 years ago

ajeecai commented 2 years ago

upload via tus may generate two files: one is a meta file containing original filename, size, etc, another is the uploaded file but with hash value as its name.

My question is why not turn it into real file name, although we could run a background process to do it according to meta file.

Thanks

kukhariev commented 2 years ago

Maybe I didn't understand the question very well.

Here are some options:

tus.on('completed' , renameToOriginal);
const opts: DiskStorageOptions = {
  maxUploadSize: '5GB',
  directory: 'upload',
  onComplete: renameToOriginal
};
const tus = new Tus(opts);

or express example

ajeecai commented 2 years ago

Hi @kukhariev, that is what I mean. Great help from you, thanks.