Professional Web Applications Themes

Copy image from one web server to another - PERL Beginners

Hello there! I need to be adviced how to implement the subject. I have URL of an image and I need to copy this to another web-server. I tried to make it with ImageMagick, but I got an error opening the file by URL. Which way could more correct to produce such operation? -- Nicolay Vasiliev http://www.soft411.com - Excellent soft archive http://www.spamliquidator.com - Kill spam...

  1. #1

    Default Copy image from one web server to another

    Hello there!

    I need to be adviced how to implement the subject. I have URL of an
    image and I need to copy this to another web-server. I tried to make it
    with ImageMagick, but I got an error opening the file by URL.

    Which way could more correct to produce such operation?

    --
    Nicolay Vasiliev

    http://www.soft411.com - Excellent soft archive
    http://www.spamliquidator.com - Kill spam

    Nicolay Guest

  2. #2

    Default Re: Copy image from one web server to another

    On Fri, 8 Oct 2004, Nicolay A. Vasiliev wrote:
     

    The standard library for writing web clients -- which, in this context,
    your web server is acting as -- is LWP. The LWP::Simple module may be
    the easiest way to do this:

    use LWP::Simple;
    $image = get("http://www.sample.url/images/sample.jpg");
    die "Couldn't get it!" unless defined $image;

    At that point, just write the contents of $image to a file.

    See the LWP::Simple perldoc for more info, or the LWP docs:

    <http://search.cpan.org/dist/libwww-perl/lib/LWP/Simple.pm>

    Or see the e-book _Web Client Programming with Perl_ by Clinton Wong:

    <http://www.oreilly.com/openbook/webclient/>

    It's a bit old, but still covers the basics.



    --
    Chris Devers
    Chris Guest

  3. #3

    Default Re: Copy image from one web server to another

    Hallo, Chris!

    Oh, in this library "getstore" is more matching I suppose.
    Thank you!

    Chris Devers wrote:
     
    >
    >
    > The standard library for writing web clients -- which, in this
    > context, your web server is acting as -- is LWP. The LWP::Simple
    > module may be the easiest way to do this:
    >
    > use LWP::Simple;
    > $image = get("http://www.sample.url/images/sample.jpg");
    > die "Couldn't get it!" unless defined $image;
    >
    > At that point, just write the contents of $image to a file.
    >
    > See the LWP::Simple perldoc for more info, or the LWP docs:
    >
    > <http://search.cpan.org/dist/libwww-perl/lib/LWP/Simple.pm>
    >
    > Or see the e-book _Web Client Programming with Perl_ by Clinton Wong:
    >
    > <http://www.oreilly.com/openbook/webclient/>
    >
    > It's a bit old, but still covers the basics.
    >
    >[/ref]

    http://www.soft411.com - Excellent soft archive
    http://www.spamliquidator.com - Kill spam

    Nicolay Guest

  4. #4

    Default Re: Copy image from one web server to another

    >>>>> "Nicolay" == Nicolay A Vasiliev <com> writes:

    Nicolay> Hallo, Chris!
    Nicolay> Oh, in this library "getstore" is more matching I suppose.

    In fact, "mirror" is even better, if it's an image that changes
    on a regular basis and you want a local copy.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Randal Guest

Similar Threads

  1. How does it copy an image up to Shockwave 3D?
    By Max in forum Macromedia Director 3D
    Replies: 0
    Last Post: January 10th, 04:32 PM
  2. Why can't I just copy an image from.......
    By sally in forum Windows Server
    Replies: 2
    Last Post: June 25th, 06:56 AM
  3. Copy/Paste One Image Over Another As Overlay
    By Phil_Galey@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 20th, 06:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139