The File Attachment control enables the user to attach a file while displaying a progress bar while uploading. When dragging a Field of type File Attachment onto the canvas, the properties displayed will be specific to that Field.
You can specify what types of files and limit the size of files for the Attachment control. See the following sections for items that need to be considered when specifying file types and sizes as they will impact runtime behavior of the control.
The following properties are available on the attachment controls:
Properties | Description |
---|---|
Allowed Types |
|
Max Size |
|
When configuring these properties, the application of the Blacklist and Web.config file entries should also be considered.
The Web.config entries are available in the following locations and can be changed according to business requirements:
<install drive>:\Program Files (x86)\K2 blackpearl\K2 smartforms Designer\Web.config
<install drive>:\Program Files (x86)\K2 blackpearl\K2 smartforms Runtime\Web.config
<!--<add key="Forms.Designer.Controls.Attachment.Blacklist" value="ade,adp,app,asa,ashx,asmx,asp,aspx,bas,bat,cdx,cer,chm,class,cmd,cnt,com,config,cpl,crt,cs,csh,der,dll,exe,fxp,gadget,
grp,hlp,hpj,hta,htr,htw,ida,idc,idq,inf,ins,isp,its,its,jar,javascript,jscript,js,jse,json,ksh,lib,lnk,mad,maf,mag,mam,maq,
mar,mas,mat,mau,mav,maw,mcf,mda,mdb,mde,mdt,mdw,mdz,msc,msh,msh1,msh1xml,msh2,msh2xml,mshxml,msi,ms-one-stub,msp,mst,ocx,ops,pcd,pif,pl,plg,prf,prg,printer,ps,ps1,ps1xml,ps2,ps2xml,psc1,psc2,pst,pst,reg,reg,scf,scr,sct,sct,shb,
shs,shs,shtm,shtml,soap,stm,svc,sys,tmp,url,vb,vbe,vbs,vbscript,vxd,vscript,vsix,vsmacros,vsw,ws,wsc,wsf,wsh,xamlx,xnk" />-->
<!--<add key="Forms.Designer.Controls.Attachment.MaxSize" value="5120" />-->
These entries are commented by default but are enforced on the environment with their default values. If you want to change the default values, un-comment the entry and change the value.
The following table is a list of Blacklist file types. These file types cannot be uploaded to the K2 server via the Attachment control. See the Backwards Compatibility section for details on releases prior to K2 smartforms 4.6.11.
Extension | Description |
---|---|
ade | Access Project Extension (Microsoft) |
adp | Access Project (Microsoft) |
app | Executable Application |
asa | ASP declarations file |
ashx | ASP.NET Web handler file. Web handlers are software modules that handle raw HTTP requests received by ASP.NET. |
asmx | ASP.NET Web Services source file |
asp | Active Server Page |
aspx | ASP.net |
bas | BASIC Source Code |
bat | Batch Processing |
cdx | Compound index |
cer | Internet Security Certificate File |
chm | Compiled HTML Help |
class | Java class file |
cmd | DOS CP/M Command File, Command File for Windows NT |
cnt | Help Contents file |
com | Command |
config | Configuration file |
cpl | Windows Control Panel Extension (Microsoft) |
crt | Certificate File |
cs | C# code file |
csh | csh Script |
der | DER Encoded X509 Certificate File |
dll | Windows dynamic-link library |
exe | Executable File |
fxp | FoxPro Compiled Source (Microsoft) |
gadget | Windows Vista gadget |
grp | SmarterMail group file |
hlp | Windows Help File |
hpj | Help project file |
hta | Hypertext Application |
htr | Script file |
htw | HTML document |
ida | Internet Information Services file |
idc | Internet database connector file |
idq | Internet data query file |
inf | Information or Setup File |
ins | IIS Internet Communications Settings (Microsoft) |
isp | IIS Internet Service Provider Settings (Microsoft) |
its | Internet Document Set, Internet Translation |
jar | Java Archive |
javascript | JavaScript Source Code |
jscript | JavaScript Source Code |
js | JavaScript Source Code |
jse | JScript Encoded Script File |
json | JavaScript Object Notation file |
ksh | UNIX Shell Script |
lib | Windows static-link library |
lnk | Windows Shortcut File |
mad | Access Module Shortcut (Microsoft) |
maf | Access (Microsoft) |
mag | Access Diagram Shortcut (Microsoft) |
mam | Access Macro Shortcut (Microsoft) |
maq | Access Query Shortcut (Microsoft) |
mar | Access Report Shortcut (Microsoft) |
mas | Access Stored Procedures (Microsoft) |
mat | Access Table Shortcut (Microsoft) |
mau | Media Attachment Unit |
mav | Access View Shortcut (Microsoft) |
maw | Access Data Access Page (Microsoft) |
mcf | Multimedia Container Format |
mda | Access Add-in (Microsoft), MDA Access 2 Workgroup (Microsoft) |
mdb | Access Application (Microsoft), MDB Access Database (Microsoft) |
mde | Access MDE Database File (Microsoft) |
mdt | Access Add-in Data (Microsoft) |
mdw | Access Workgroup Information (Microsoft) |
mdz | Access Wizard Template (Microsoft) |
msc | Microsoft Management Console Snap-in Control File (Microsoft) |
msh | Microsoft Shell |
msh1 | Microsoft Shell |
msh1xml |
Microsoft Shell |
msh2 |
Microsoft Shell |
msh2xml |
Microsoft Shell |
mshxml |
Microsoft Shell |
msi | Windows Installer File (Microsoft) |
ms-one-stub | Microsoft OneNote stub |
msp | Windows Installer Update |
mst | Windows SDK Setup Transform Script |
ocx | Object Linking and Embedding (OLE) Control Extension |
ops | Office Profile Settings File |
pcd | Visual Test (Microsoft) |
pif | Windows Program Information File (Microsoft) |
pl | Perl script |
plg | Developer Studio Build Log |
prf | Windows System File |
prg | Program File |
printer | Printer file |
ps | Windows PowerShell |
ps1 | Windows PowerShell |
ps1xml | Windows PowerShell |
ps2 | Windows PowerShell |
ps2xml | Windows PowerShell |
psc1 | Windows PowerShell |
psc2 | Windows PowerShell |
pst | MS Exchange Address Book File, Outlook Personal Folder File (Microsoft) |
reg | Registration entries |
scf | Windows Explorer command file |
scr | Windows Screen Saver |
sct | Windows Script Component, Foxpro Screen (Microsoft) |
shb | Windows Shortcut into a Document |
shs | Shell Scrap Object File |
shtm | HTML file that contains server-side directives |
shtml | HTML file that contains server-side directives |
soap | Simple Object Access Protocol file |
stm | HTML file that contains server-side directives |
svc | Windows Communication Foundation (WCF) service file |
sys | Real mode device driver |
tmp | Temporary File/Folder |
url | Internet Location |
vb | VBScript File or Any Visual Basic Source |
vbe | VBScript Encoded Script File |
vbs | VBScript Script File, Visual Basic for Applications Script |
vbscript | VBScript Script File, Visual Basic for Applications Script |
vxd | Virtual document exchange |
vscript | VBScript Script File, Visual Basic for Applications Script |
vsix | Visual Studio Extension |
vsmacros | Visual Studio .NET Binary-based Macro Project (Microsoft) |
vsw | Visio Workspace File (Microsoft) |
ws | Windows Script File |
wsc | Windows Script Component |
wsf | Windows Script File |
wsh | Windows Script Host Settings File |
xamlx | Visual Studio Workflow service file |
xnk | Exchange Public Folder Shortcut |
Rules can be used to set file types and sizes at runtime such as the Set a control’s properties rule action. See the Control and Form Properties Actions topic for more detail.
The global maximum File and Image size that can be attached is dictated by the following setting in the Web.config file in the system.web section.
<httpRuntime maxRequestLength="16384" />
When creating a Form that consists of many Views and multiple States the Form rules might not be visible after adding an additional State. This occurs when the Form definition increases and exceeds the Maximum Request Length specified in the Web.config. The maxRequestLength can be edited to enlarge the size of the Form definition.
The default maximum value is set as 16384 KB (kilobyte) which is an integer value and can be changed to the required value in kilobytes. See the following link for more details about the maxRequestLength setting: https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength(v=vs.110).aspx
<install drive>:\Program Files (x86)\K2 blackpearl\K2 smartforms Designer
<install drive>:\Program Files (x86)\K2 blackpearl\K2 smartforms Runtime
requestFiltering is a feature that can be configured in Internet Information Services (IIS).
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
See the following link for more detail: https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits
If this setting is enabled on your environment, it is important to note that the minimum value of the maxRequestLength setting, the requestFiltering setting and the MaxSize setting will limit the attachments upload.
Beginning with K2 smartforms 4.6.11, previously allowed files may now not be allowed due to the inclusion of the Blacklist feature. To update the Blacklist to include or remove certain files, see the Web.config entries section of this topic. Change the Web.config file to exclude those files you want to upload and include files that should be restricted. Following is a list of Blacklist files restricted prior to K2 smartforms 4.6.11. This restriction was not previously configurable.
cpl, vxd, cmd, pif, com, msi, scr, ps, wsh, ocx, dll, bat, exe, vbs, vbe,.vb, aspx, vbscript, vscript, javascript, jscript, js.
The Check Box control is available in the Attachment section of the Controls found in the View Designer and Form Designer.
Properties | Description | Can be set in runtime using Rules |
---|---|---|
Name | A unique identifier for the selected control. This property is required | No |
Field | A read-only property displaying the field that is bound to the selected control | No |
Data Type | A drop-down list containing the types of values that the selected control can accept | No |
Watermark | The text to display when the control is not populated | Yes, see Control Properties Actions for more information |
Tooltip | The value to be displayed when the cursor is hovered over the control during runtime | Yes, see Control Properties Actions for more information |
File Name |
The file name of the uploaded file. Rules can be used to populate another field or another control with this property |
Yes, see Control Properties Actions for more information |
Allowed Types | File or image types allowed for the attachment control. If the property is blank, all types are allowed with the exception of the types included in the blacklist as per the web.config file. If types are specified, only those types will be accepted at runtime for the specific attachment control. A comma delimiter is used to separate the types. No spaces are allowed between the types and the delimiter. An example is jpg,gif,pdf,docx | Yes, see Control Properties Actions for more information |
Max Size | File size limit set for each individual control (KB,MB,GB or TB) | Yes, see Control Properties Actions for more information |
Show Information | A Boolean value used to establish whether the control should show file information during runtime | Yes, see Control Properties Actions for more information |
Borderless | A Boolean value used to establish whether the control has borders during runtime | Yes, see Control Properties Actions for more information |
Width | Adjust the width of the control (any whole percentage up to 100%, number or pixel value up to 32767px) | Yes, see Control Properties Actions for more information |
Tab Index |
Used to define a sequence that users follow when they use the Tab key to navigate through a page at runtime |
Yes, see Control Properties Actions for more information |
Visible | A Boolean value used to establish whether the control is visible during runtime | Yes, see Control Properties Actions for more information |
Enabled | A Boolean value used to establish whether the control is enabled during runtime | Yes, see Control Properties Actions for more information |
Read-Only | A Boolean value used to establish whether the control is read-only during runtime | Yes, see Control Properties Actions for more information |
Styles | Opens the Style Builder enabling the user to specify style features like Format, Font, Borders, Padding and Margins. See the Style Builder topic for more information on styling options | No |
Conditional Styles | Opens the Conditional Formatting Designer used to design styles that will apply only when certain conditions are met. See the Conditional Styles section for more information | No |
How to use rules to change the edit state of View and Form controls and tables
Video | Links | Learn | Support |
No videos found for this article K2 on YouTube
No Additional links found for this article
No self-learning content for this article Try some scenarios...
No relevant support links available for this article
|