Coder Social home page Coder Social logo

Comments (5)

huwmorris avatar huwmorris commented on May 24, 2024

Looking at this now. First task: when an upload is stopped, need to add an "Abort button". This would clear the chunks from the upload directory and remove the upload from the list.

from b2share.

huwmorris avatar huwmorris commented on May 24, 2024

So progress so far:

I've added an "Abort" button which only shows when the upload is stopped.

I'm trying to understand how to do anything with the button.

In simplestore-deposit.js are the following lines for dealing with the Start and Stop buttons.
$('#uploadfiles').click(function(e) {

$('#stopupload').click(function(d) {

Can anyone explain what 'd' and 'e' are in this context? How would I use this to call a python function which would clear the upload folder of the unwanted chunks?

I looked at the plupload documentation regarding chunks, and not having to upload a file in full if some of the chunks had already been uploaded. It says:
"In real world scenario you might want to store the chunks as separate files and combine them only after all of them are uploaded. This way you will be able to monitor the state of each chunk, request reuploading of the failed one, resume paused or failed uploads, etc.

There is an effort currently to build a convenient server-side handler class, that will handle it all. We are going to translate it into various server-side languages once it's ready. You can contribute if you want and are proficient in - some :)"

I couldn't find any other way to resume an upload, so if it is possible at all, it looks like it will have to be done the hard way.

from b2share.

emanueldima avatar emanueldima commented on May 24, 2024

The javascript code in question is a jQuery call to bind an event handler for any click event generated on the DOM elements with the id 'uploadfiles' and 'stopupload'. The e and d are parameters to the event handler function, and in this case are eventObject. More to be found at http://api.jquery.com/click/ and http://api.jquery.com/category/events/event-object/

from b2share.

stranak avatar stranak commented on May 24, 2024

There is a quite good system for uploading and sharing big data. They have an HTML5 upload with stop and resume feature and support for big files. I don't know whether their architecture is such that we could integrate the upload part from them: http://filesender.org

from b2share.

stranak avatar stranak commented on May 24, 2024

Just came across a jQuery File Upload widget that looks very similar to what we are using, but it supports resuming uploads by using chunked upload (like we do) and remembering uploaded bytes.

from b2share.

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.