| Newsletter documentation | Contained in the Newsletter distribution. |
Newsletter::Html::Upload - Fileupload!
Version 0.01
Attchments and embedded files inside of the mails
Perhaps a little code snippet.
use Newsletter::Html::Upload;
my $foo = Newsletter::Html::Upload->new();
...
A list of functions that can be exported. You can delete this section if you don't export anything, such as for a purely object-oriented module.
Dominik Hochreiter, <dominik at soft.uni-linz.ac.at>
Please report any bugs or feature requests to
bug-newsletter-html-upload at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Newsletter.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Newsletter
You can also look for information at:
Copyright 2006 Dominik Hochreiter, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Newsletter documentation | Contained in the Newsletter distribution. |
package Newsletter::Html::Upload; use warnings; use strict; sub fileUpload { my ($self, $cgiParamName ) = @_; my $file = $self->{'cgi'}->param( $cgiParamName ); return "No File !" if(!$file); my $saveFile = $file; $saveFile =~s/^.*\\([\w\d_\- \(\)]+\.[\w]+)$/$1/g; $saveFile =~s/ /_/g; my $savePath = $self->{'uploadPath'}.'/'.$saveFile; open (FILE, '>'.$savePath) or die "Error processing file: $savePath, $!\n"; binmode FILE; $self->_lowRead( \$file, \*FILE ); close FILE; # return file+path on server return $saveFile; } sub _lowRead { my ($self, $file, $FILE_HANLDE) = @_; my $data; while(read $$file, $data, 32768) { #1 #1024 print $FILE_HANLDE $data; } }
our $VERSION = '0.01';
1; # End of Newsletter::Html::Upload