Cloud Functions: zip multiple documents from Cloud Storage











up vote
0
down vote

favorite












I already searched through a lot of questions on stack overflow but couldn't find a fitting answer from which I can derive the answer I need:



I want to zip multiple files from a folder within Google Cloud Storage/Firebase Storage with a Cloud Function.



I already found the solution for zipping documents from the local filesystem but could not derive how to do it within a Cloud Function for Cloud Storage.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I already searched through a lot of questions on stack overflow but couldn't find a fitting answer from which I can derive the answer I need:



    I want to zip multiple files from a folder within Google Cloud Storage/Firebase Storage with a Cloud Function.



    I already found the solution for zipping documents from the local filesystem but could not derive how to do it within a Cloud Function for Cloud Storage.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I already searched through a lot of questions on stack overflow but couldn't find a fitting answer from which I can derive the answer I need:



      I want to zip multiple files from a folder within Google Cloud Storage/Firebase Storage with a Cloud Function.



      I already found the solution for zipping documents from the local filesystem but could not derive how to do it within a Cloud Function for Cloud Storage.










      share|improve this question













      I already searched through a lot of questions on stack overflow but couldn't find a fitting answer from which I can derive the answer I need:



      I want to zip multiple files from a folder within Google Cloud Storage/Firebase Storage with a Cloud Function.



      I already found the solution for zipping documents from the local filesystem but could not derive how to do it within a Cloud Function for Cloud Storage.







      firebase zip google-cloud-storage google-cloud-functions






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 at 16:35









      ktm125

      12812




      12812
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Google Cloud Storage supports the decompressive form of transcoding but not compressive form of transcoding[1]. However at Cloud Storage any user can store gzip-compressed file.



          To zip multiple documents from Cloud Storage using Cloud Functions, you can download the files from Cloud Storage to functions instances using gcs.bucket.file(filePath).download, zip the file and reupload the files to the Cloud Storage. Here you will find an example of downloading, transforming, and uploading a file[2]. You can find an example to zip multiple files in this StackOverflow thread[3]. This document[4] explains how you can upload objects to Cloud Storage using Console, Gsutil, Code Sample or REST APIs.



          [1]https://cloud.google.com/storage/docs/transcoding#transcoding_and_gzip
          [2]https://firebase.google.com/docs/functions/gcp-storage-events#download_transform_and_upload_a_file
          [3]how to convert multiple files to compressed zip file using node js
          [4]https://cloud.google.com/storage/docs/uploading-objects






          share|improve this answer





















            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',
            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%2f53435135%2fcloud-functions-zip-multiple-documents-from-cloud-storage%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








            up vote
            0
            down vote













            Google Cloud Storage supports the decompressive form of transcoding but not compressive form of transcoding[1]. However at Cloud Storage any user can store gzip-compressed file.



            To zip multiple documents from Cloud Storage using Cloud Functions, you can download the files from Cloud Storage to functions instances using gcs.bucket.file(filePath).download, zip the file and reupload the files to the Cloud Storage. Here you will find an example of downloading, transforming, and uploading a file[2]. You can find an example to zip multiple files in this StackOverflow thread[3]. This document[4] explains how you can upload objects to Cloud Storage using Console, Gsutil, Code Sample or REST APIs.



            [1]https://cloud.google.com/storage/docs/transcoding#transcoding_and_gzip
            [2]https://firebase.google.com/docs/functions/gcp-storage-events#download_transform_and_upload_a_file
            [3]how to convert multiple files to compressed zip file using node js
            [4]https://cloud.google.com/storage/docs/uploading-objects






            share|improve this answer

























              up vote
              0
              down vote













              Google Cloud Storage supports the decompressive form of transcoding but not compressive form of transcoding[1]. However at Cloud Storage any user can store gzip-compressed file.



              To zip multiple documents from Cloud Storage using Cloud Functions, you can download the files from Cloud Storage to functions instances using gcs.bucket.file(filePath).download, zip the file and reupload the files to the Cloud Storage. Here you will find an example of downloading, transforming, and uploading a file[2]. You can find an example to zip multiple files in this StackOverflow thread[3]. This document[4] explains how you can upload objects to Cloud Storage using Console, Gsutil, Code Sample or REST APIs.



              [1]https://cloud.google.com/storage/docs/transcoding#transcoding_and_gzip
              [2]https://firebase.google.com/docs/functions/gcp-storage-events#download_transform_and_upload_a_file
              [3]how to convert multiple files to compressed zip file using node js
              [4]https://cloud.google.com/storage/docs/uploading-objects






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Google Cloud Storage supports the decompressive form of transcoding but not compressive form of transcoding[1]. However at Cloud Storage any user can store gzip-compressed file.



                To zip multiple documents from Cloud Storage using Cloud Functions, you can download the files from Cloud Storage to functions instances using gcs.bucket.file(filePath).download, zip the file and reupload the files to the Cloud Storage. Here you will find an example of downloading, transforming, and uploading a file[2]. You can find an example to zip multiple files in this StackOverflow thread[3]. This document[4] explains how you can upload objects to Cloud Storage using Console, Gsutil, Code Sample or REST APIs.



                [1]https://cloud.google.com/storage/docs/transcoding#transcoding_and_gzip
                [2]https://firebase.google.com/docs/functions/gcp-storage-events#download_transform_and_upload_a_file
                [3]how to convert multiple files to compressed zip file using node js
                [4]https://cloud.google.com/storage/docs/uploading-objects






                share|improve this answer












                Google Cloud Storage supports the decompressive form of transcoding but not compressive form of transcoding[1]. However at Cloud Storage any user can store gzip-compressed file.



                To zip multiple documents from Cloud Storage using Cloud Functions, you can download the files from Cloud Storage to functions instances using gcs.bucket.file(filePath).download, zip the file and reupload the files to the Cloud Storage. Here you will find an example of downloading, transforming, and uploading a file[2]. You can find an example to zip multiple files in this StackOverflow thread[3]. This document[4] explains how you can upload objects to Cloud Storage using Console, Gsutil, Code Sample or REST APIs.



                [1]https://cloud.google.com/storage/docs/transcoding#transcoding_and_gzip
                [2]https://firebase.google.com/docs/functions/gcp-storage-events#download_transform_and_upload_a_file
                [3]how to convert multiple files to compressed zip file using node js
                [4]https://cloud.google.com/storage/docs/uploading-objects







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 6 at 3:12









                Mohammad I

                11




                11






























                    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%2f53435135%2fcloud-functions-zip-multiple-documents-from-cloud-storage%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

                    How to ignore python UserWarning in pytest?

                    Alexandru Averescu