Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts

    Is it possible to perform checksum before FTP uploading

    I have a code to enable users to use Net::FTP to upload files to my server. Is there a way I can perform a checksum of the files before they are uploaded?

    Thanks.

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    68
    Thanks
    0
    Thanked 28 Times in 28 Posts
    If it's "before" it's uploaded, then what are you comparing it to?

    - Miller

  • Users who have thanked miller for this post:

    camaross (06-11-2011)

  • #3
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts
    I compare it with the checksum results 'after' it is uploaded. Does that make sense?

    Quote Originally Posted by miller View Post
    If it's "before" it's uploaded, then what are you comparing it to?

    - Miller

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    68
    Thanks
    0
    Thanked 28 Times in 28 Posts
    Just use the MD5 module:

    Code:
    use MD5;
    
    use strict;
    use warnings;
    
    my $context = new MD5;
    
    my $file = $0;
    open my $fh, $file or die "Can't open $file: $!";
    
    $context->addfile($fh);
    
    my $string = $context->hexdigest();
    
    print "String = $string\n";
    Alternatively, you can use the unix utility:

    Code:
    md5sum foo.bar
    - Miller

  • Users who have thanked miller for this post:

    camaross (06-11-2011)

  • #5
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts
    Thank you very much. I will test it soon.


    Quote Originally Posted by miller View Post
    Just use the MD5 module:

    Code:
    use MD5;
    
    use strict;
    use warnings;
    
    my $context = new MD5;
    
    my $file = $0;
    open my $fh, $file or die "Can't open $file: $!";
    
    $context->addfile($fh);
    
    my $string = $context->hexdigest();
    
    print "String = $string\n";
    Alternatively, you can use the unix utility:

    Code:
    md5sum foo.bar
    - Miller


  •  

    Posting Permissions

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