The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.


PowerTools::Upload::Blob - Additional Perl tool for Apache::ASP data uploading


        default table

        CREATE TABLE  `files`.`file` (
          `file_id` int(10) unsigned NOT NULL auto_increment,
          `file_name` varchar(255) NOT NULL,
          `file_type` varchar(255) NOT NULL,
          `file_blob` longblob NOT NULL,
          `file_size` int(10) unsigned NOT NULL,
          PRIMARY KEY  (`file_id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

        .asp file

        use PowerTools::Upload::Blob;

        my $up = PowerTools::Upload::File->new(                 # Create new object
                path => 'E:/instale/test',                      # Path to directory where files will be stored (default: '/tmp')
                field => 'plik',                                # Form field name (<input type"file" name="plik">, default: 'file')
                limit => $Server->Config("FileUploadMax"),      # File size limit (default 100000000)
                request => $Request,                            # Request object
                clamav => 1,                                    # Scan with ClamAV when uploading (0 -> no / 1 -> yes, default: 0)
                overwrite => 0                                  # Overwrite file (0 -> no / 1 -> yes, default: 1)

        my $ret = $up->upload();                                # Upload file
        print $ret->{'filename'}."<br>";                        # Returns filename
        print $ret->{'filesize'}."<br>";                        # Returns filesize
        print $ret->{'filepath'}."<br>";                        # Returns filepath
        print $ret->{'filescan'}."<br>";                        # Returns filescan
        print $ret->{'filemime'}."<br>";                        # Returns filemime
        print $ret->{'copytime'}."<br>";                        # Returns copytime
        print $ret->{'status'};                                 # Returns upload status


Piotr Ginalski, <>


Copyright (C) 2007 by Piotr Ginalski

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.