Refresh Software Support Center

Contact Support
 

Email:
support@refreshsoftware.com

Phone:
508-318-4480


  Link to this page

Home >  Tree >  Reference >  Data Types >  Type -996

Type -996

SR2 Type -996 is SR2 file upload data type. This type allow users to upload any data into an asset. Using this method allows developers to restrict the use of the uploaded file, the file will only be associated with this asset. If someone uploads an image, it can't be used in the WYSIWYG.

 
This is an example of an Asset Type with a Type -996 field.


Note: Type -996 requires some additional columns in the database. SR2 needs to store the name, Type, size and Data. This is done by appending the XML column name to each field. See the following examples.

Example #1:
If I wanted users to upload photos and I wanted to store the field as photos the following columns would need to be added to the database.

alter table people add photoname varchar(255);
alter table people add photoType varchar(255);
alter table people add photoSize int;
alter table people add photoData image;


The following is the XML entry:

      <field>
         <columnName>photo</columnName>
         <title>Photo</title>
         <label>Photo</label>
         <type>-996</type>
         <isRequired>1</isRequired>
         <defaultValue></defaultValue>
         <maxLength></maxLength>
         <isReadOnly>0</isReadOnly>
         <panel>Photo</panel>
      </field>



Example #2:
If I wanted users to upload PDFs and I wanted to store the field as pressdata the following columns would need to be added to the database.

alter table people add pressdataname varchar(255);
alter table people add pressdataType varchar(255);
alter table people add pressdataSize int;
alter table people add pressdataData image;


The following is the XML entry:

      <field>
         <columnName>pressdata</columnName>
         <title>PDF Document</title>
         <label>PDF Document</label>
         <type>-996</type>
         <isRequired>1</isRequired>
         <defaultValue></defaultValue>
         <maxLength></maxLength>
         <isReadOnly>0</isReadOnly>
         <panel>Documents</panel>
      </field>

 


 

Sample Create Table Statement

CREATE TABLE myimage (
id varchar(32) NOT NULL  PRIMARY KEY,
filename varchar(255),
filetype varchar(255),
filesize int,
filedata image,
content text
)