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

Two files same filename

MichalKrakow opened this issue · comments

Describe the bug
It's probably documentation issue cause i find it hard to belive this is not yet addressed.
When uploading same file, or event different file with the same filename, server does not provide any obvious way to address the issue and increment filename with some suffix. TUS specification say, the file location is being estabilished with first response to client so at this point we should have some way to check if file does not exist in storage already and change the incoming file destination filename. It should be event automatically resolved by server with some way to override by configuration.

To Reproduce
Steps to reproduce the behavior:

  1. uload file test.jpg
  2. uload different file test.jpg from another client
  3. in storage you find only first one...

Expected behavior
File with suffix should be stored in storage

So if this feature is already in place, please make it stand out in documentation since lack of it makes this library useless.

commented

Hi @MichalKrakow, you need to organize your uploads in the server to prevent that from happening. See #79 and #52.

Thanks for taking Your time to response ❤️

So to wrap it up for future users lets say:
YOU DONT CHANGE YOUR FILENAME ON UPLOAD, YOU CHANGE ITS LOCATION IN STORAGE
and that's by design so either you roll with this storage design, or you can change it after upload is done by adopting 'tus-server.upload.complete' event.

Thanks, its clear to me now - but still documentation should point it out, especially considering that default configuration without this piece of code will introduce bugs to this library users code logic.

Best regards,
Thank so much!

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.