Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autostart=false #3

Open
harshinim opened this issue Aug 22, 2016 · 6 comments
Open

autostart=false #3

harshinim opened this issue Aug 22, 2016 · 6 comments

Comments

@harshinim
Copy link

With autostart as false, if I want to start uploading on click of a button - how do I do it? The examples and documentation does not cover this scenario.

@lionng429
Copy link
Owner

lionng429 commented Aug 22, 2016

I think I failed to recognise this scenario and I am going to create a patch for this.

As an alternative, you can create your own UploadHandler components, and using them as children of UploadManager. It will equip you custom UploadHandler component with an upload function. That is the quickest solution I could think out besides waiting for my patch.

And the patch will be something like this for your reference:

<UploadHandler file={file}>
  {
    (upload) => {
      // your original children code
      <button onClick={upload}>Upload Now</button>
    }
  }
</UploadHandler>

@harshinim
Copy link
Author

Thanks for your quick response. My requirement is more to with UploadManager I think - I drag and drop multiple files, make some changes to the table listing the files and then click on upload button which is on top of the table. Now, when I do this, I will need all the files to be uploaded simultaneously. Also, do you support uploading in chunks?

@lionng429
Copy link
Owner

I did the similar thing in my side project. Try not to tie the Receiver and the UploadManager too tight together.

I created two separated stores for receiver and uploader. The receiver store is responsible to receive the dropped file and the corresponding edits.

When finished edit, you can create your own startUpload action to transfer the files in receiver store to uploader store, and pump into UploadManager component.

does it make sense? You can also define your own strategy for the communication between receiver and uploader.

and it does not support chunks. It uses superagent as the request handler, and I am not sure it will support custom request handler in the future.

@harshinim
Copy link
Author

oh brilliant, that worked...I had not thought of this!! :-)
Is there a limit on max size of file that can be uploaded? And also I was interested in chunks so that the upload is faster - any idea how the performance is with superagent?

@lionng429
Copy link
Owner

I am sorry that I have no specialties on http connections. I think it just provides the basic support on multipart, and no more than a http client. I saw something related here though.

@harshinim
Copy link
Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants