Comments (9)
Hi, [up]
I think it could be cool to store last uploaded byte in a variable, so that chunkSize can be modified while upload (so, if someone uploads from a mobile device, and gets 4G ... It can adjust speed and not do useful requests)
from resumable.js.
Hi,
i have prepared a sample implementation at AidasK/resumable.js@23:master...master
ResumableFile now is going to have two additional params:
- $.currentSpeed - current file upload speed based on "measureSpeedInterval" parameter
- $.averageSpeed - this is implemented based on formula: averageSpeed = SMOOTHING_FACTOR * lastSpeed + (1-SMOOTHING_FACTOR) * averageSpeed; http://stackoverflow.com/questions/2779600/how-to-estimate-download-time-remaining-accurately
I have also added two params: measureSpeedInterval and speedSmoothingFactor. I think they need a better naming.
from resumable.js.
If you are going to have a lot of mobile users I would probably just set the chunksize to 512k and have the number of simultaneous uploads shrink when upload speeds are low.
On 23 sep. 2014, at 16:53, Steffen Tiedemann Christensen [email protected] wrote:
Yup -- absolutely doable, although it would require a bit of extra complexity on the server side to stitch together chunks. The real way of doing it would be do simply send the start and end bytes I gather and then have the server stream bytes to a fully assigned file.
The question remain though if it's worth the bother -- is the real life use cases justify the change?
—
Reply to this email directly or view it on GitHub.
from resumable.js.
I like the idea, and have actually had this feature in the custom Flash uploaders I've been using before. The reason I didn't include it in Resumable originally was that the actual calculation tended to be inaccurate at best -- mostly because HTTP uploads tend not to perform linearly for bigger files. And in this case there's the additional complexity of connect times, seek times, test times, resume times to consider.
My approach would probably be to:
- Create a timer firing every few seconds which indexes the currently uploaded file size. This index should probably be trimmed over time.
- Create functions
$.remainingFileSize()
and$.currentUploadSpeed()
. This latter would look at the above index to see the average upload speed in bytes/sec over the past minute or two. It would also consider if the upload was started or resumed more recently that this (starting/pausing/resuming could just clear the index, I guess). - Create one or two helper functions using the above to calculate and format the time remaining.
from resumable.js.
Hey, have you seen my implementation? I would like to finish this feature and move on to new ideas.
from resumable.js.
I like the idea of the changing chunk size -- but wondering if it's really applicable in any real use case? On mobile, would you even know what the available bandwidth is ahead of sending the chunk?
The last uploaded byte can be a bit of a moving target with Resumable: Since multiple chunks are uploaded at once, a file is not uploaded linearly -- in fact the first chunk set to upload might be the last to finish.
from resumable.js.
I thought of some way to have the chunk size increased if it took <1 second to upload, else decrease it. But you're right, there's no way to know for the first chunk (worse) when upload speed is lowered, resumable's main feature "fails", as it can't be really paused.
As for uploading multiple chunks at one, I were not aware and don't know if it's a good point (and I supposed it to be ran linearly, appending chunk to a file ..)
from resumable.js.
You could force the first chunks to be small and have Resumable upload them non-simultaneously. when speed is high increase the chunks to what is configuredm switch to the simoultaneous number of uploads that is configured. When the chunks need to shrink, just first have the uploader fall back to 1 upload, wait for all other chunks to complete and then decreas the chunksize. the only tricky part is to identify the order of the chunks in the backend because you might end up slicing chunks that persist somewhere in the middle of a file.
from resumable.js.
Yup -- absolutely doable, although it would require a bit of extra complexity on the server side to stitch together chunks. The real way of doing it would be do simply send the start and end bytes I gather and then have the server stream bytes to a fully assigned file.
The question remain though if it's worth the bother -- is the real life use cases justify the change?
from resumable.js.
Related Issues (20)
- Facing out of memory error while uploading <3.5Gb file using Resumable.js client
- Have an option to send "complete" request when all chunks have been uploaded
- Provide minified version in the downloads
- First and Last Chunks server side validation
- resumablejs.com down HOT 4
- Ability to sanitize file name before uploading
- 429 Error - Too many requests - when uploading larger files. HOT 1
- Node.JS: Cannot read property 'toString' of undefined (empty request body and files)
- Large files result in 429 server error - too many requests HOT 1
- Fewer chunks failing while uploading Zip and TIF files HOT 1
- How to get Upload File Count in Resumable.js ? HOT 1
- Not sequentially chunk requests sending
- re-combine the mp4 chunks results in a not-playable file HOT 1
- internal server error in last chunk HOT 1
- Error occured when uploading to shared drive folder HOT 1
- Upload directly from client to GCS HOT 1
- How to use resumable.js to track file upload progress
- Samples for Dotnet isn't working
- Upload method is not dynamic
- Typescript for maxFileSize wrong message
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resumable.js.