Coder Social home page Coder Social logo

Comments (12)

markflorkowski avatar markflorkowski commented on August 16, 2024 1

We definitely want to add an onUploadProgress() callback. I'll have to think a bit more about onUploadBegin(), but I think it makes sense as well.

from uploadthing.

Mr0Bread avatar Mr0Bread commented on August 16, 2024 1

@markflorkowski onUploadBegin prop had been released. I guess this issue can be closed now

from uploadthing.

markflorkowski avatar markflorkowski commented on August 16, 2024 1

onUploadBegin has been added as of v5.4.0 🙌

from uploadthing.

irtaza9 avatar irtaza9 commented on August 16, 2024

The better should be to have all the features like onuploadprogress and onuploadbegins, etc. I think axios is offering onuploadprogress callback.

from uploadthing.

irtaza9 avatar irtaza9 commented on August 16, 2024

Cool, let me know if you guys need any help. I'll be happy to add my part.

from uploadthing.

markflorkowski avatar markflorkowski commented on August 16, 2024

Feel free to open a PR if you have ideas on this and want to contribute! Otherwise, i have put this in our backlog to be addressed soon(tm)

from uploadthing.

irtaza9 avatar irtaza9 commented on August 16, 2024

I was thinking about it but It's tough
image

from uploadthing.

markflorkowski avatar markflorkowski commented on August 16, 2024

I am thinking if we use XHR instead of fetch, it has onprogress built in, which could work. Alternatively we could do uploads as multipart, and use the completion of each part to update the progress.

from uploadthing.

irtaza9 avatar irtaza9 commented on August 16, 2024

And that is what I want to suggest but I thought all the package is build around fetch may be you people don't go for XHR. btw what about axios?

XHR:

   const xhr = new XMLHttpRequest();
   xhr.addEventListener("loadstart", handleEvent);
   xhr.addEventListener("load", handleEvent);
   xhr.addEventListener("loadend", handleEvent);
   xhr.addEventListener("progress", handleEvent);
   xhr.addEventListener("error", handleEvent);
   xhr.addEventListener("abort", handleEvent);

helper-fun

   function handleEvent(e) {
      console.log(e.loaded)
   }

I got this resource over mdn

from uploadthing.

ryanpratama14 avatar ryanpratama14 commented on August 16, 2024

onUploadBegin is not working somehow...

"uploadthing": "^6.0.3",
"@uploadthing/react": "^6.0.2",

from uploadthing.

Shijel avatar Shijel commented on August 16, 2024

@ryanpratama14 Same here

"uploadthing": "^6.0.4"
"@uploadthing/react": "^6.0.2",

from uploadthing.

markflorkowski avatar markflorkowski commented on August 16, 2024

Yeah looks like we broke it when we introduced multipart uploads. Will be fixed in the next release.

from uploadthing.

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.