/
INSTALLATION.txt
91 lines (81 loc) · 3.45 KB
/
INSTALLATION.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
1. Copy the 'fancy_upload' folder to a directory in your site. I recommend /includes/js/ and will use that going forward.
2. Using the included demo.html as a guide, place the code inside of your form.
EXAMPLE:
<form action="upload.cfm" method="post" enctype="multipart/form-data">
<!-- Fancy Upload -->
<script type="text/javascript" src="/includes/js/fancy_upload/fancyupload.js"></script>
<style type="text/css">
.filefield {
background:transparent;
-moz-opacity:0.0 ;
filter:alpha(opacity: 000);
opacity: 0.0;
}
.pickfile {
width:width:60px !important;
BACKGROUND: #5F893D !important;
color: white !important;
}
</style>
<div style="width:100px; height:20px;">
<div style="white-space:nowrap; position:absolute;">
<input type="text" size="1" style="visibility:hidden;" id="mover" name="mover"><input type="button" value="Pick File" class="pickfile">
<!-- if you want the label on the right instead of bottom <span id="fileToUploadattach"><img src="/includes/js/fancy_upload/icons/null.gif" height="16" width="16">No file selected</span> -->
</div>
<div style="position: absolute;" id="fileToUploadholder" class="filefield">
<cfinput type="file" size="1" name="fileToUpload" id="fileToUpload" onchange="showfile(this.name, this.value, 'fileToUploadattach', 'jpg');"style="width:width:60px;">
</div>
</div>
<!-- label on bottom --><span id="fileToUploadattach"><img src="/includes/js/fancy_upload/icons/null.gif" height="16" width="16">No file selected</span>
<!--- WHEN A PAGE IS RELOADED --->
<script type="text/javascript">
showfile('fileToUpload', $('fileToUpload').value, 'fileToUploadattach', 'jpg');
</script>
<!-- // Fancy Upload -->
<input type="sumbit">
</form>
ADVANCED USAGE
It is possible to use a server language to display multiple Fancy Uploads in a single form. Included is a version for ColdFusion.
* The loading of the base JS and CSS is now automatic
* I am using CFinclude instead of a CFC here so that CFinput will work (with fields being required, etc).
* Note that in this example on the first image is required (FUrequired=1).
<cfform name="photoSet7" action="photos.cfm" method="post" enctype="multipart/form-data">
<table>
<tbody>
<tr class="rowheader">
<td colspan="5">New Image Set</td>
</tr>
<tr class="rowrow1">
<td>Icon (35px × 35px)</td>
<td>Main Image (340px × 390px)</td>
<td>Large (480px × 640px)</td>
<td>Zoomed (1020px × 1170px)</td>
<td> </td>
</tr>
<Tr class="rowrow3">
<td>Add:<br>
<cfset request.FUinputName="icon7">
<cfset request.FUmessage="Choose an Icon">
<cfset request.FUrequired="1">
<cfinclude template="../../../includes/js/fancy_upload/fancyupload.cfm">
</td>
<td>Add:<br>
<cfset request.FUinputName="main7">
<cfset request.FUmessage="Choose a Main Image">
<cfinclude template="../../../includes/js/fancy_upload/fancyupload.cfm">
</td>
<td>Add:<br>
<cfset request.FUinputName="large7">
<cfset request.FUmessage="Choose a Large Image">
<cfinclude template="../../../includes/js/fancy_upload/fancyupload.cfm">
</td>
<td>Add:<br>
<cfset request.FUinputName="zoomed7">
<cfset request.FUmessage="Choose a Zoomed Image">
<cfinclude template="../../../includes/js/fancy_upload/fancyupload.cfm">
</td>
<td align="center"><input type="submit" value="Add"></td>
</tr>
</tbody>
</table>
</cfform>