Tus server Integration with shrine “Dealing with large uploads filesize > 1 gb”












0














I am trying to integrate the tus-server with shrine to upload the video files to the Vimeo.



Client.js



this.uppy = new Uppy({
id: 'uppy1',
autoProceed: false,
debug: true,
restrictions: {
allowedFileTypes: ['.mp4'],
},
allowMultipleUploads: true,
})
.use(Tus, { endpoint: `${API_BASE}/files` })
/* .use(XHRUpload, { endpoint: `${API_BASE}/files`,
formData: true,
bundle: false,
fieldName: 'file',
headers: getHeaders(), */
})
.use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
.use(Dropbox, { serverUrl: 'https://companion.uppy.io/' });




# config/routes.rb (Rails)
Rails.application.routes.draw do
mount Tus::Server => "/files"
end


Here, by default tus server, It directly uploads the file to data/ folder with file in project root.



What I want to achieve is to upload the video files to the vimeo



Like:




  1. File goes to ${API_BASE}/files

  2. Mine controller gets the file

  3. I pass the file to the vimeo (using vimeo_me2)

  4. Vimeo uploads the file, send the video_url back, I now insert the video_url in the certain video table.

  5. All these above process need to be resumable.


I am using vimeo_me2 gem.



Can Anyone provide solution to integrate/configure tus server with shrine.



Any help is much much appreciated!










share|improve this question



























    0














    I am trying to integrate the tus-server with shrine to upload the video files to the Vimeo.



    Client.js



    this.uppy = new Uppy({
    id: 'uppy1',
    autoProceed: false,
    debug: true,
    restrictions: {
    allowedFileTypes: ['.mp4'],
    },
    allowMultipleUploads: true,
    })
    .use(Tus, { endpoint: `${API_BASE}/files` })
    /* .use(XHRUpload, { endpoint: `${API_BASE}/files`,
    formData: true,
    bundle: false,
    fieldName: 'file',
    headers: getHeaders(), */
    })
    .use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
    .use(Dropbox, { serverUrl: 'https://companion.uppy.io/' });




    # config/routes.rb (Rails)
    Rails.application.routes.draw do
    mount Tus::Server => "/files"
    end


    Here, by default tus server, It directly uploads the file to data/ folder with file in project root.



    What I want to achieve is to upload the video files to the vimeo



    Like:




    1. File goes to ${API_BASE}/files

    2. Mine controller gets the file

    3. I pass the file to the vimeo (using vimeo_me2)

    4. Vimeo uploads the file, send the video_url back, I now insert the video_url in the certain video table.

    5. All these above process need to be resumable.


    I am using vimeo_me2 gem.



    Can Anyone provide solution to integrate/configure tus server with shrine.



    Any help is much much appreciated!










    share|improve this question

























      0












      0








      0







      I am trying to integrate the tus-server with shrine to upload the video files to the Vimeo.



      Client.js



      this.uppy = new Uppy({
      id: 'uppy1',
      autoProceed: false,
      debug: true,
      restrictions: {
      allowedFileTypes: ['.mp4'],
      },
      allowMultipleUploads: true,
      })
      .use(Tus, { endpoint: `${API_BASE}/files` })
      /* .use(XHRUpload, { endpoint: `${API_BASE}/files`,
      formData: true,
      bundle: false,
      fieldName: 'file',
      headers: getHeaders(), */
      })
      .use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
      .use(Dropbox, { serverUrl: 'https://companion.uppy.io/' });




      # config/routes.rb (Rails)
      Rails.application.routes.draw do
      mount Tus::Server => "/files"
      end


      Here, by default tus server, It directly uploads the file to data/ folder with file in project root.



      What I want to achieve is to upload the video files to the vimeo



      Like:




      1. File goes to ${API_BASE}/files

      2. Mine controller gets the file

      3. I pass the file to the vimeo (using vimeo_me2)

      4. Vimeo uploads the file, send the video_url back, I now insert the video_url in the certain video table.

      5. All these above process need to be resumable.


      I am using vimeo_me2 gem.



      Can Anyone provide solution to integrate/configure tus server with shrine.



      Any help is much much appreciated!










      share|improve this question













      I am trying to integrate the tus-server with shrine to upload the video files to the Vimeo.



      Client.js



      this.uppy = new Uppy({
      id: 'uppy1',
      autoProceed: false,
      debug: true,
      restrictions: {
      allowedFileTypes: ['.mp4'],
      },
      allowMultipleUploads: true,
      })
      .use(Tus, { endpoint: `${API_BASE}/files` })
      /* .use(XHRUpload, { endpoint: `${API_BASE}/files`,
      formData: true,
      bundle: false,
      fieldName: 'file',
      headers: getHeaders(), */
      })
      .use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
      .use(Dropbox, { serverUrl: 'https://companion.uppy.io/' });




      # config/routes.rb (Rails)
      Rails.application.routes.draw do
      mount Tus::Server => "/files"
      end


      Here, by default tus server, It directly uploads the file to data/ folder with file in project root.



      What I want to achieve is to upload the video files to the vimeo



      Like:




      1. File goes to ${API_BASE}/files

      2. Mine controller gets the file

      3. I pass the file to the vimeo (using vimeo_me2)

      4. Vimeo uploads the file, send the video_url back, I now insert the video_url in the certain video table.

      5. All these above process need to be resumable.


      I am using vimeo_me2 gem.



      Can Anyone provide solution to integrate/configure tus server with shrine.



      Any help is much much appreciated!







      javascript ruby-on-rails shrine tus






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 11:14









      p0k8_p0k8_

      3,93131932




      3,93131932
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Author of tus-ruby-server and Shrine here :)



          You have two options as far as I'm concerned: use Vimeo's "pull upload", or upload directly to Vimeo.



          A. Pull upload



          Vimeo's pull upload allows you to give Vimeo the link to your file, and let it download and save the file for you. This should be resumable, because tus-ruby-server supports range requests, and it seems that Vimeo will use that:




          We even handle any connectivity issues that might come up.




          The vimeo_me2 gem has a method for pull upload. So you can just give it the link to the tus file, e.g if you have a Movie with a video attachment:



          vimeo_client.pull_upload("Name of video", movie.video.url)


          B. Direct upload to Vimeo



          Vimeo also implements the tus resumable upload protocol, so theoretically it should be possible to use Uppy to upload directly to Vimeo. In that case you could get rid of tus-ruby-server.



          I haven't personally tried this approach. It seems like there is an extra first step of creating the video, but the rest of it looks like the standard tus protocol. These is an example app created by the authors of Uppy, so I think you should be able to copy-paste a lot of the stuff from there.





          The approach I don't recommend is downloading the file from the tus server and uploading it to Vimeo using the vimeo_me2 gem. Firstly, the download won't be resumable, as the down gem that shrine-tus uses doesn't yet support resumable downloads. Secondly, while vimeo_me2 uses the tus protocol for uploading, it doesn't seem to do anything to resume the upload in case of connection errors. It also appears to load the whole file into memory.



          In any case, options A and B will be more performant.






          share|improve this answer























          • ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
            – p0k8_
            Nov 26 '18 at 5:45












          • ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
            – p0k8_
            Nov 26 '18 at 5:49












          • To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
            – janko-m
            Nov 26 '18 at 11:59










          • So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
            – p0k8_
            Dec 5 '18 at 8:04










          • Docs say that i need to create an companion server for that?
            – p0k8_
            Dec 5 '18 at 8:05











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53445652%2ftus-server-integration-with-shrine-dealing-with-large-uploads-filesize-1-gb%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Author of tus-ruby-server and Shrine here :)



          You have two options as far as I'm concerned: use Vimeo's "pull upload", or upload directly to Vimeo.



          A. Pull upload



          Vimeo's pull upload allows you to give Vimeo the link to your file, and let it download and save the file for you. This should be resumable, because tus-ruby-server supports range requests, and it seems that Vimeo will use that:




          We even handle any connectivity issues that might come up.




          The vimeo_me2 gem has a method for pull upload. So you can just give it the link to the tus file, e.g if you have a Movie with a video attachment:



          vimeo_client.pull_upload("Name of video", movie.video.url)


          B. Direct upload to Vimeo



          Vimeo also implements the tus resumable upload protocol, so theoretically it should be possible to use Uppy to upload directly to Vimeo. In that case you could get rid of tus-ruby-server.



          I haven't personally tried this approach. It seems like there is an extra first step of creating the video, but the rest of it looks like the standard tus protocol. These is an example app created by the authors of Uppy, so I think you should be able to copy-paste a lot of the stuff from there.





          The approach I don't recommend is downloading the file from the tus server and uploading it to Vimeo using the vimeo_me2 gem. Firstly, the download won't be resumable, as the down gem that shrine-tus uses doesn't yet support resumable downloads. Secondly, while vimeo_me2 uses the tus protocol for uploading, it doesn't seem to do anything to resume the upload in case of connection errors. It also appears to load the whole file into memory.



          In any case, options A and B will be more performant.






          share|improve this answer























          • ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
            – p0k8_
            Nov 26 '18 at 5:45












          • ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
            – p0k8_
            Nov 26 '18 at 5:49












          • To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
            – janko-m
            Nov 26 '18 at 11:59










          • So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
            – p0k8_
            Dec 5 '18 at 8:04










          • Docs say that i need to create an companion server for that?
            – p0k8_
            Dec 5 '18 at 8:05
















          1














          Author of tus-ruby-server and Shrine here :)



          You have two options as far as I'm concerned: use Vimeo's "pull upload", or upload directly to Vimeo.



          A. Pull upload



          Vimeo's pull upload allows you to give Vimeo the link to your file, and let it download and save the file for you. This should be resumable, because tus-ruby-server supports range requests, and it seems that Vimeo will use that:




          We even handle any connectivity issues that might come up.




          The vimeo_me2 gem has a method for pull upload. So you can just give it the link to the tus file, e.g if you have a Movie with a video attachment:



          vimeo_client.pull_upload("Name of video", movie.video.url)


          B. Direct upload to Vimeo



          Vimeo also implements the tus resumable upload protocol, so theoretically it should be possible to use Uppy to upload directly to Vimeo. In that case you could get rid of tus-ruby-server.



          I haven't personally tried this approach. It seems like there is an extra first step of creating the video, but the rest of it looks like the standard tus protocol. These is an example app created by the authors of Uppy, so I think you should be able to copy-paste a lot of the stuff from there.





          The approach I don't recommend is downloading the file from the tus server and uploading it to Vimeo using the vimeo_me2 gem. Firstly, the download won't be resumable, as the down gem that shrine-tus uses doesn't yet support resumable downloads. Secondly, while vimeo_me2 uses the tus protocol for uploading, it doesn't seem to do anything to resume the upload in case of connection errors. It also appears to load the whole file into memory.



          In any case, options A and B will be more performant.






          share|improve this answer























          • ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
            – p0k8_
            Nov 26 '18 at 5:45












          • ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
            – p0k8_
            Nov 26 '18 at 5:49












          • To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
            – janko-m
            Nov 26 '18 at 11:59










          • So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
            – p0k8_
            Dec 5 '18 at 8:04










          • Docs say that i need to create an companion server for that?
            – p0k8_
            Dec 5 '18 at 8:05














          1












          1








          1






          Author of tus-ruby-server and Shrine here :)



          You have two options as far as I'm concerned: use Vimeo's "pull upload", or upload directly to Vimeo.



          A. Pull upload



          Vimeo's pull upload allows you to give Vimeo the link to your file, and let it download and save the file for you. This should be resumable, because tus-ruby-server supports range requests, and it seems that Vimeo will use that:




          We even handle any connectivity issues that might come up.




          The vimeo_me2 gem has a method for pull upload. So you can just give it the link to the tus file, e.g if you have a Movie with a video attachment:



          vimeo_client.pull_upload("Name of video", movie.video.url)


          B. Direct upload to Vimeo



          Vimeo also implements the tus resumable upload protocol, so theoretically it should be possible to use Uppy to upload directly to Vimeo. In that case you could get rid of tus-ruby-server.



          I haven't personally tried this approach. It seems like there is an extra first step of creating the video, but the rest of it looks like the standard tus protocol. These is an example app created by the authors of Uppy, so I think you should be able to copy-paste a lot of the stuff from there.





          The approach I don't recommend is downloading the file from the tus server and uploading it to Vimeo using the vimeo_me2 gem. Firstly, the download won't be resumable, as the down gem that shrine-tus uses doesn't yet support resumable downloads. Secondly, while vimeo_me2 uses the tus protocol for uploading, it doesn't seem to do anything to resume the upload in case of connection errors. It also appears to load the whole file into memory.



          In any case, options A and B will be more performant.






          share|improve this answer














          Author of tus-ruby-server and Shrine here :)



          You have two options as far as I'm concerned: use Vimeo's "pull upload", or upload directly to Vimeo.



          A. Pull upload



          Vimeo's pull upload allows you to give Vimeo the link to your file, and let it download and save the file for you. This should be resumable, because tus-ruby-server supports range requests, and it seems that Vimeo will use that:




          We even handle any connectivity issues that might come up.




          The vimeo_me2 gem has a method for pull upload. So you can just give it the link to the tus file, e.g if you have a Movie with a video attachment:



          vimeo_client.pull_upload("Name of video", movie.video.url)


          B. Direct upload to Vimeo



          Vimeo also implements the tus resumable upload protocol, so theoretically it should be possible to use Uppy to upload directly to Vimeo. In that case you could get rid of tus-ruby-server.



          I haven't personally tried this approach. It seems like there is an extra first step of creating the video, but the rest of it looks like the standard tus protocol. These is an example app created by the authors of Uppy, so I think you should be able to copy-paste a lot of the stuff from there.





          The approach I don't recommend is downloading the file from the tus server and uploading it to Vimeo using the vimeo_me2 gem. Firstly, the download won't be resumable, as the down gem that shrine-tus uses doesn't yet support resumable downloads. Secondly, while vimeo_me2 uses the tus protocol for uploading, it doesn't seem to do anything to resume the upload in case of connection errors. It also appears to load the whole file into memory.



          In any case, options A and B will be more performant.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 25 '18 at 2:25

























          answered Nov 23 '18 at 20:08









          janko-mjanko-m

          3,74542441




          3,74542441












          • ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
            – p0k8_
            Nov 26 '18 at 5:45












          • ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
            – p0k8_
            Nov 26 '18 at 5:49












          • To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
            – janko-m
            Nov 26 '18 at 11:59










          • So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
            – p0k8_
            Dec 5 '18 at 8:04










          • Docs say that i need to create an companion server for that?
            – p0k8_
            Dec 5 '18 at 8:05


















          • ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
            – p0k8_
            Nov 26 '18 at 5:45












          • ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
            – p0k8_
            Nov 26 '18 at 5:49












          • To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
            – janko-m
            Nov 26 '18 at 11:59










          • So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
            – p0k8_
            Dec 5 '18 at 8:04










          • Docs say that i need to create an companion server for that?
            – p0k8_
            Dec 5 '18 at 8:05
















          ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
          – p0k8_
          Nov 26 '18 at 5:45






          ATM I won't be dealing with approach A. Approach B might be what I am looking for. If I implement direct upload to Vimeo from clientside, I need to look after success or error response sent from the Vimeo and send an API request to the mine server and update the video table with Vimeo data_url if the response is a success.
          – p0k8_
          Nov 26 '18 at 5:45














          ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
          – p0k8_
          Nov 26 '18 at 5:49






          ATM I'm not dealing with Oauth. I'll just use the public access_token from vimeo and every user can upload videos in mine account. (No oauth req.). I looked at vimeo-uppy-thing. It involves whole oauth procedure and I even didn't get much of it. What mine concern is user selects the video from uppy dashboard clicks the Upload button video gets uploaded to Vimeo. That's it (no oauth).
          – p0k8_
          Nov 26 '18 at 5:49














          To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
          – janko-m
          Nov 26 '18 at 11:59




          To my knowledge these are the only two solutions with acceptable performance, and both are implementable.
          – janko-m
          Nov 26 '18 at 11:59












          So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
          – p0k8_
          Dec 5 '18 at 8:04




          So, if I need to upload videos to AWS s3 bucket. What approaches should I take? Using uppy aws s3 multipart plugin.
          – p0k8_
          Dec 5 '18 at 8:04












          Docs say that i need to create an companion server for that?
          – p0k8_
          Dec 5 '18 at 8:05




          Docs say that i need to create an companion server for that?
          – p0k8_
          Dec 5 '18 at 8:05


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53445652%2ftus-server-integration-with-shrine-dealing-with-large-uploads-filesize-1-gb%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What visual should I use to simply compare current year value vs last year in Power BI desktop

          Alexandru Averescu

          Trompette piccolo