How to write a image from the live url into local system using rsync











up vote
0
down vote

favorite












I want to save a image or load a image which is on this example image link into my computer using rsync command into the terminal. Can anybody tell me how to save the image using terminal command? Path is:- /home/iron/go/src/










share|improve this question







New contributor




user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    0
    down vote

    favorite












    I want to save a image or load a image which is on this example image link into my computer using rsync command into the terminal. Can anybody tell me how to save the image using terminal command? Path is:- /home/iron/go/src/










    share|improve this question







    New contributor




    user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I want to save a image or load a image which is on this example image link into my computer using rsync command into the terminal. Can anybody tell me how to save the image using terminal command? Path is:- /home/iron/go/src/










      share|improve this question







      New contributor




      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I want to save a image or load a image which is on this example image link into my computer using rsync command into the terminal. Can anybody tell me how to save the image using terminal command? Path is:- /home/iron/go/src/







      image terminal rsync






      share|improve this question







      New contributor




      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      user10665991

      33




      33




      New contributor




      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user10665991 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Here I'm adding my answer to load a image from server to the local system or you can say remote machine to local machine



          Here is the little code



          package main

          import (
          "fmt"
          "io"
          "log"
          "net/http"
          "os"
          )

          func main() {
          url := "https://www.bookingkoala.com/wp-content/uploads/2017/03/cropped-logo.png" // your url
          // don't worry about errors
          response, e := http.Get(url) // getting data from the url
          if e != nil || response == nil {
          return
          }
          defer response.Body.Close()

          //open a file for writing
          file, err := os.Create("/home/iron/go/src/abc/sada.png") // define path and file name where you want to store the image.
          if err != nil || response == nil {
          // log.Fatal(err)
          return
          }
          defer file.Close()

          // Use io.Copy to just dump the response body to the file. This supports huge files
          _, err = io.Copy(file, response.Body) // it will make or copy a file of the image in the link
          if err != nil {
          log.Fatal(err)
          }
          fmt.Println("Success!")
          }


          I think it satisfied your question.






          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
            });


            }
            });






            user10665991 is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372121%2fhow-to-write-a-image-from-the-live-url-into-local-system-using-rsync%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
            1
            down vote













            Here I'm adding my answer to load a image from server to the local system or you can say remote machine to local machine



            Here is the little code



            package main

            import (
            "fmt"
            "io"
            "log"
            "net/http"
            "os"
            )

            func main() {
            url := "https://www.bookingkoala.com/wp-content/uploads/2017/03/cropped-logo.png" // your url
            // don't worry about errors
            response, e := http.Get(url) // getting data from the url
            if e != nil || response == nil {
            return
            }
            defer response.Body.Close()

            //open a file for writing
            file, err := os.Create("/home/iron/go/src/abc/sada.png") // define path and file name where you want to store the image.
            if err != nil || response == nil {
            // log.Fatal(err)
            return
            }
            defer file.Close()

            // Use io.Copy to just dump the response body to the file. This supports huge files
            _, err = io.Copy(file, response.Body) // it will make or copy a file of the image in the link
            if err != nil {
            log.Fatal(err)
            }
            fmt.Println("Success!")
            }


            I think it satisfied your question.






            share|improve this answer

























              up vote
              1
              down vote













              Here I'm adding my answer to load a image from server to the local system or you can say remote machine to local machine



              Here is the little code



              package main

              import (
              "fmt"
              "io"
              "log"
              "net/http"
              "os"
              )

              func main() {
              url := "https://www.bookingkoala.com/wp-content/uploads/2017/03/cropped-logo.png" // your url
              // don't worry about errors
              response, e := http.Get(url) // getting data from the url
              if e != nil || response == nil {
              return
              }
              defer response.Body.Close()

              //open a file for writing
              file, err := os.Create("/home/iron/go/src/abc/sada.png") // define path and file name where you want to store the image.
              if err != nil || response == nil {
              // log.Fatal(err)
              return
              }
              defer file.Close()

              // Use io.Copy to just dump the response body to the file. This supports huge files
              _, err = io.Copy(file, response.Body) // it will make or copy a file of the image in the link
              if err != nil {
              log.Fatal(err)
              }
              fmt.Println("Success!")
              }


              I think it satisfied your question.






              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                Here I'm adding my answer to load a image from server to the local system or you can say remote machine to local machine



                Here is the little code



                package main

                import (
                "fmt"
                "io"
                "log"
                "net/http"
                "os"
                )

                func main() {
                url := "https://www.bookingkoala.com/wp-content/uploads/2017/03/cropped-logo.png" // your url
                // don't worry about errors
                response, e := http.Get(url) // getting data from the url
                if e != nil || response == nil {
                return
                }
                defer response.Body.Close()

                //open a file for writing
                file, err := os.Create("/home/iron/go/src/abc/sada.png") // define path and file name where you want to store the image.
                if err != nil || response == nil {
                // log.Fatal(err)
                return
                }
                defer file.Close()

                // Use io.Copy to just dump the response body to the file. This supports huge files
                _, err = io.Copy(file, response.Body) // it will make or copy a file of the image in the link
                if err != nil {
                log.Fatal(err)
                }
                fmt.Println("Success!")
                }


                I think it satisfied your question.






                share|improve this answer












                Here I'm adding my answer to load a image from server to the local system or you can say remote machine to local machine



                Here is the little code



                package main

                import (
                "fmt"
                "io"
                "log"
                "net/http"
                "os"
                )

                func main() {
                url := "https://www.bookingkoala.com/wp-content/uploads/2017/03/cropped-logo.png" // your url
                // don't worry about errors
                response, e := http.Get(url) // getting data from the url
                if e != nil || response == nil {
                return
                }
                defer response.Body.Close()

                //open a file for writing
                file, err := os.Create("/home/iron/go/src/abc/sada.png") // define path and file name where you want to store the image.
                if err != nil || response == nil {
                // log.Fatal(err)
                return
                }
                defer file.Close()

                // Use io.Copy to just dump the response body to the file. This supports huge files
                _, err = io.Copy(file, response.Body) // it will make or copy a file of the image in the link
                if err != nil {
                log.Fatal(err)
                }
                fmt.Println("Success!")
                }


                I think it satisfied your question.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 15 hours ago









                Puneet

                617115




                617115






















                    user10665991 is a new contributor. Be nice, and check out our Code of Conduct.










                     

                    draft saved


                    draft discarded


















                    user10665991 is a new contributor. Be nice, and check out our Code of Conduct.













                    user10665991 is a new contributor. Be nice, and check out our Code of Conduct.












                    user10665991 is a new contributor. Be nice, and check out our Code of Conduct.















                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372121%2fhow-to-write-a-image-from-the-live-url-into-local-system-using-rsync%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

                    Wiesbaden

                    Marschland

                    Dieringhausen