summaryrefslogtreecommitdiff
path: root/saveImg.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'saveImg.cgi')
-rw-r--r--saveImg.cgi54
1 files changed, 0 insertions, 54 deletions
diff --git a/saveImg.cgi b/saveImg.cgi
deleted file mode 100644
index 0447d61..0000000
--- a/saveImg.cgi
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use CGI;
-use CGI::Carp qw ( fatalsToBrowser );
-use LWP::Simple;
-use MIME::Base64;
-
-##---------------------------------------------------------------------------------------
-##INPUT PARAMETERS THAT CAN BE CUSTOMIZED
-##---------------------------------------------------------------------------------------
-##Location of texture and heightmap files to be downloaded into
-my $outputDir="d:/tmp/files";
-##---------------------------------------------------------------------------------------
-##GET THE PICTURE NAME AND BASE64 DATA FROM THE HTTP POST REQUEST
-##---------------------------------------------------------------------------------------
-my $query = new CGI;
-##Get image name
-my $imageName = $query->param("name");
-if ( !$imageName )
- {
- ##Problem retrieving the data
- print $query->header ( );
- print "no";
- exit;
- }
-##Get encoded image
-my $encodedContents = $query->param("picture");
-if ( !$encodedContents )
- {
- ##Problem retrieving the data
- print $query->header ( );
- print "no";
- exit;
- }
-
-##---------------------------------------------------------------------------------------
-##GET HANDLE AND SAVE THE PICTURE CONTENTS TO THE OUTPUT DIR
-##---------------------------------------------------------------------------------------
-##Decode picture data
-my $decodedContents = decode_base64($encodedContents);
-
-##Save picture
-my $filename = $outputDir . "/" . $imageName;
-open(IMG,">$filename");
-binmode IMG;
-print IMG $decodedContents;
-close IMG;
-
-##---------------------------------------------------------------------------------------
-##PRINT SUCCESS IN HTML FORMAT
-##---------------------------------------------------------------------------------------
-print $query->header ( );
-print "yes";
-exit;