Giter Club home page Giter Club logo

Comments (8)

KhaledSMQ avatar KhaledSMQ commented on May 29, 2024

i believe you can use the meta data to add information regarding the session details.

from tus-js-client.

devalexqt avatar devalexqt commented on May 29, 2024

But if I upload file and them change session and try to upload this file again (us other user) it says what file already uploaded. :(

from tus-js-client.

KhaledSMQ avatar KhaledSMQ commented on May 29, 2024

before upload the files add the session details to meta-data, when you reactive the file in your backend fetch this meta-data and assign it to your user ex. into your database.

before upload fill the object for what ever information you need such as session id , user id  
metadata = {}
https://github.com/tus/tus-js-client/blob/40448e99699b9f9addc8ef3ca191d1f966a8f0d5/demo/node.js#L13

from tus-js-client.

Acconut avatar Acconut commented on May 29, 2024

@devalexqt: Is it possible to bind uploader to user session? Different user => different session and different files.

I am sorry but I don't understand your question. What user session are you talking about? Is it stored on the server or inside the browser? Would you be so kind and explain it more thoroughly?

from tus-js-client.

devalexqt avatar devalexqt commented on May 29, 2024

Session Id saved on server in DB, and user see all files binded to this session. All ok, but if session expired and user reload page with new session id ( without any binded files) and try to upload same file then uploader say that file is already uploaded, but no one file is connected to new user session, and it's wrong, I need to bind uploader to the session (in browser).

from tus-js-client.

devalexqt avatar devalexqt commented on May 29, 2024

In other words, if user login as user1 and upload file one.mp4 and then logout and login as different user2, and try to upload same one.mp4 file again. In this case user2 will be see message that file already uploaded, but it's wrong!

from tus-js-client.

Acconut avatar Acconut commented on May 29, 2024

In this case user2 will be see message that file already uploaded, but it's wrong!

It's not wrong if you forget about the user system. tus-js-client notices that the same file has already been uploaded by this browser (it does not care about users or sessions). You can disable this behaviour by setting the resume option to false (https://github.com/tus/tus-js-client#tusdefaultoptions). This will cause tus-js-client to not check whether it has uploaded in the past and should fix your issue.

from tus-js-client.

Acconut avatar Acconut commented on May 29, 2024

Closing this issue due to inactivity. Feel free to leave a comment if you want to continue the discussion :)

from tus-js-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.