Helpfulbox Now Offers Free POS Software for restaurants, kiosk, and any other retails business completely free used windows cashier system or as full blown POS. You will able to print to kitchen, display orders on the kitchen screen, manage inventory, employee, report, customer loyalty offers, employee management, delivery address track and much more, al for free.

uploading images or any files using perl in ubuntu linux?


Date: Mon-Feb-20-2012-
Response
0
first thing you need to do is make sure you script belong to data-www that is Apache username or it wont work. and set the permission of the folder you are uploading to 755

here your html file part

<html>
<head>
<title>Upload Form</title>
<body>
<h1>Upload Form</h1>
<form method="post" action="test2.cgi" enctype="multipart/form-data">
<center>
Enter a file to upload: <input type="file" name="upfile"><br>
<input type="submit" name="button" value="Upload File">
</center>
</form>


-----------------------------------------------------here you perl script
#!/usr/bin/perl -wT use strict; 
use CGI; 
use CGI::Carp qw ( fatalsToBrowser ); 
use File::Basename;


$CGI::POST_MAX = 1024 * 5000;


my $safe_filename_characters = "a-zA-Z0-9_.-";


my $upload_dir = "/var/www/images";


my $query = new CGI; my $filename = $query->param("upfile"); 
$filename =~ /([^<>]*)/;
$filename =~ s/.*[\/\\](.*)/$1/;

if ( !$filename ) 
{ print $query->header ( ); 
print "There was a problem uploading your photo (try a smaller file)."; 
exit; }


my $upload_filehandle = $query->upload("upfile");



open ( UPLOADFILE, ">$upload_dir/$filename" ) or die "$!"; 
binmode UPLOADFILE; while ( <$upload_filehandle> ) { print UPLOADFILE; 
} close UPLOADFILE;
[d] By: Guest
Date: Mon-Feb-20-2012
Response
What is 1 + 100



Helpfulbox Now Offers Free POS Software

for restaurants, kiosk, and any other retails business completely free. It can be used as windows cashier system or as full blown POS. You will able to print to kitchen, display orders on the kitchen screen, manage inventory, employee, report, customer loyalty offers, employee management, delivery address track and much more, all for free.

Just Updated::