Signed-off-by: Digimer <digimer@alteeve.ca>main
parent
0979402ecf
commit
d68b85fe9e
8 changed files with 361 additions and 35 deletions
@ -0,0 +1,73 @@ |
||||
#!/usr/bin/perl |
||||
|
||||
use strict; |
||||
use warnings; |
||||
use CGI; |
||||
|
||||
my $cgi = CGI->new; |
||||
print q|Content-type: text/html; charset=utf-8 |
||||
|
||||
<!DOCTYPE html> |
||||
<html lang="en_CA"> |
||||
<head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
||||
|
||||
<!-- Disable caching during development. --> |
||||
<meta http-equiv="cache-control" content="max-age=0" /> |
||||
<meta http-equiv="cache-control" content="no-cache" /> |
||||
<meta http-equiv="expires" content="0" /> |
||||
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> |
||||
<meta http-equiv="pragma" content="no-cache" /> <title>Alteeve - Striker</title> |
||||
|
||||
<link rel="stylesheet" href="/skins/alteeve/main.css" media="screen" /> |
||||
<script type="text/javascript" src="/jquery-latest.js"></script> |
||||
<script type="text/javascript" src="/skins/alteeve/main.js"></script> |
||||
|
||||
<!-- NOTE: These are for jquery-ui using the 'smoothness' skin. We may want to move this under the skin directory in case other skins want to use different jquery-ui skins someday. --> |
||||
<link rel="stylesheet" href="/jquery-ui-latest/jquery-ui.css"> |
||||
<script type="text/javascript" src="/jquery-ui-latest/jquery-ui.js"></script> |
||||
|
||||
<script type="text/javascript" src="/skins/alteeve/files.js"></script> |
||||
<link rel="stylesheet" href="/skins/alteeve/files.css"> |
||||
|; |
||||
|
||||
|
||||
my $lightweight_fh = $cgi->upload('field_name'); |
||||
# undef may be returned if it's not a valid file handle |
||||
if ($cgi->param()) |
||||
{ |
||||
print q| |
||||
<title>Saving File...</title> |
||||
</head> |
||||
<body> |
||||
|; |
||||
my $filename = $cgi->upload('upload_file'); |
||||
my $out = "/mnt/shared/incoming/".$filename; |
||||
print "Saving file: [".$out."]\n"; |
||||
my $cgi_file_handle = $cgi->param('upload_file'); |
||||
open(my $file_handle, ">$out") or die "failed to write: [$out], error: $!\n"; |
||||
while(<$cgi_file_handle>) |
||||
{ |
||||
print $file_handle $_; |
||||
} |
||||
close $file_handle; |
||||
print "Done.\n"; |
||||
} |
||||
else |
||||
{ |
||||
print q| |
||||
<title>Test Upload</title> |
||||
</head> |
||||
<body> |
||||
<h1>Upload file</h1> |
||||
<form method="post" enctype="multipart/form-data"> |
||||
<!-- <input type="file" name="upload_file" value="Choose file"> --> |
||||
<!-- <input type="submit" name="submit" value="Upload"> --> |
||||
Upload |
||||
<div id="fileuploader">Upload</div> |
||||
</form> |
||||
|; |
||||
} |
||||
print "</body>\n"; |
||||
|
||||
exit(0); |
@ -0,0 +1,147 @@ |
||||
/* From: http://hayageek.github.io/jQuery-Upload-File/4.0.11/uploadfile.css */ |
||||
.ajax-file-upload-statusbar { |
||||
border: 1px solid #0ba1b5; |
||||
margin-top: 10px; |
||||
width: 420px; |
||||
margin-right: 10px; |
||||
margin: 5px; |
||||
-moz-border-radius: 4px; |
||||
-webkit-border-radius: 4px; |
||||
border-radius: 4px; |
||||
padding: 5px 5px 5px 15px |
||||
} |
||||
|
||||
.ajax-file-upload-filename { |
||||
width: 300px; |
||||
height: auto; |
||||
margin: 0 5px 5px 0px; |
||||
|
||||
} |
||||
|
||||
.ajax-file-upload-filesize { |
||||
width: 50px; |
||||
height: auto; |
||||
margin: 0 5px 5px 0px; |
||||
display: inline-block; |
||||
vertical-align:middle; |
||||
} |
||||
.ajax-file-upload-progress { |
||||
margin: 5px 10px 5px 0px; |
||||
position: relative; |
||||
width: 250px; |
||||
border: 1px solid #ddd; |
||||
padding: 1px; |
||||
border-radius: 3px; |
||||
display: inline-block; |
||||
color:#FFFFFF; |
||||
|
||||
} |
||||
.ajax-file-upload-bar { |
||||
background-color: #0ba1b5; |
||||
width: 0; |
||||
height: 20px; |
||||
border-radius: 3px; |
||||
color:#FFFFFF; |
||||
|
||||
} |
||||
.ajax-file-upload-percent { |
||||
position: absolute; |
||||
display: inline-block; |
||||
top: 3px; |
||||
left: 48% |
||||
} |
||||
.ajax-file-upload-red { |
||||
-moz-box-shadow: inset 0 39px 0 -24px #e67a73; |
||||
-webkit-box-shadow: inset 0 39px 0 -24px #e67a73; |
||||
box-shadow: inset 0 39px 0 -24px #e67a73; |
||||
background-color: #e4685d; |
||||
-moz-border-radius: 4px; |
||||
-webkit-border-radius: 4px; |
||||
border-radius: 4px; |
||||
display: inline-block; |
||||
color: #fff; |
||||
font-family: arial; |
||||
font-size: 13px; |
||||
font-weight: normal; |
||||
padding: 4px 15px; |
||||
text-decoration: none; |
||||
text-shadow: 0 1px 0 #b23e35; |
||||
cursor: pointer; |
||||
vertical-align: top; |
||||
margin: 5px 10px 5px 0px; |
||||
} |
||||
.ajax-file-upload-green { |
||||
background-color: #77b55a; |
||||
-moz-border-radius: 4px; |
||||
-webkit-border-radius: 4px; |
||||
border-radius: 4px; |
||||
margin: 0; |
||||
padding: 0; |
||||
display: inline-block; |
||||
color: #fff; |
||||
font-family: arial; |
||||
font-size: 13px; |
||||
font-weight: normal; |
||||
padding: 4px 15px; |
||||
text-decoration: none; |
||||
cursor: pointer; |
||||
text-shadow: 0 1px 0 #5b8a3c; |
||||
vertical-align: top; |
||||
margin: 5px 10px 5px 0px; |
||||
} |
||||
.ajax-file-upload { |
||||
font-family: Arial, Helvetica, sans-serif; |
||||
font-size: 16px; |
||||
font-weight: bold; |
||||
padding: 15px 20px; |
||||
cursor:pointer; |
||||
line-height:20px; |
||||
height:25px; |
||||
margin:0 10px 10px 0; |
||||
display: inline-block; |
||||
background: #fff; |
||||
border: 1px solid #e8e8e8; |
||||
color: #888; |
||||
text-decoration: none; |
||||
border-radius: 3px; |
||||
-webkit-border-radius: 3px; |
||||
-moz-border-radius: 3px; |
||||
-moz-box-shadow: 0 2px 0 0 #e8e8e8; |
||||
-webkit-box-shadow: 0 2px 0 0 #e8e8e8; |
||||
box-shadow: 0 2px 0 0 #e8e8e8; |
||||
padding: 6px 10px 4px 10px; |
||||
color: #fff; |
||||
background: #2f8ab9; |
||||
border: none; |
||||
-moz-box-shadow: 0 2px 0 0 #13648d; |
||||
-webkit-box-shadow: 0 2px 0 0 #13648d; |
||||
box-shadow: 0 2px 0 0 #13648d; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
.ajax-file-upload:hover { |
||||
background: #3396c9; |
||||
-moz-box-shadow: 0 2px 0 0 #15719f; |
||||
-webkit-box-shadow: 0 2px 0 0 #15719f; |
||||
box-shadow: 0 2px 0 0 #15719f; |
||||
} |
||||
|
||||
.ajax-upload-dragdrop |
||||
{ |
||||
|
||||
border:2px dotted #A5A5C7; |
||||
width:420px; |
||||
color: #DADCE3; |
||||
text-align:left; |
||||
vertical-align:middle; |
||||
padding:10px 10px 0px 10px; |
||||
} |
||||
|
||||
.state-hover |
||||
{ |
||||
border:2px solid #A5A5C7; |
||||
} |
||||
.ajax-file-upload-container |
||||
{ |
||||
margin:20px 0px 20px 0px; |
||||
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue