API CreateDownloadFile: Porovnání verzí

Z Podpora.nextis.cz
Přejít na: navigace, hledání
(Založena nová stránka s textem „==== Description ==== Method allows You to create new download file in system. ==== Exact name ==== <code>API_CreateDownloadFile</code> ==== Type ==== St…“)
 
Řádka 16: Řádka 16:
 
!Relation
 
!Relation
 
|-
 
|-
|@WorkshopID
+
|@ValidFromDate
 +
|datetime
 +
|
 +
|Valid from date
 +
|
 +
|-
 +
|@ValidToDate
 +
|datetime
 +
|
 +
|Valid to date
 +
|
 +
|-
 +
|@GroupName
 +
|nvarchar(200)
 +
|
 +
|Group name
 +
|
 +
|-
 +
|@Title
 +
|nvarchar(200)
 +
|
 +
|Title
 +
|
 +
|-
 +
|@Description
 +
|nvarchar(2000)
 +
|
 +
|Description
 +
|
 +
|-
 +
|@FileName
 +
|nvarchar(255)
 +
|
 +
|File name
 +
|
 +
|-
 +
|@SortIndex
 
|int
 
|int
 
|
 
|
|ID of workshop from workshop list (see relation)
+
|Sort index
|API_GetWorkshops.ID
+
|
 +
|-
 +
|@FILEDATA
 +
|varbinary(max)
 +
|
 +
|File data
 +
|
 
|}
 
|}
  
 
==== Example ====
 
==== Example ====
 
<syntaxhighlight lang="sql">
 
<syntaxhighlight lang="sql">
EXEC [API_CreateDownloadFile] @WorkshopID = 1 ,@Name = 'Name' ,@Street = 'Street' ,@City = 'City' ,@ZIPCode = 'ZIPCode' ,@Country = 'Country' ,@Region = 'Region' ,@State ='Česká republika' ,@StateID = 15797 ,@Phone = '+420 556 621 300' ,@Fax = '+420 596 790 789' ,@MobilePhone = '+420 556 621 301' ,@Email = 'info@nextis.cz' ,@Web = 'www.nextis.cz'
+
Declare @fILE AS VARBINARY(MAX)
 +
Select @fILE = CAST(bulkcolumn AS VARBINARY(MAX))
 +
FROM OPENROWSET(
 +
            BULK
 +
            'C:\test.pdf',
 +
            SINGLE_BLOB ) AS x
 +
 +
EXEC [API_CreateDownloadFile] @ValidFromDate = null ,@ValidToDate = null ,@GroupName= 'GroupName' ,@Title= 'Title' ,@Description= 'Description' ,@FileName= 'test.pdf' ,@SortIndex= 0 ,@FILEDATA= @fILE
 +
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
==== Notices ====
 
==== Notices ====
 
None.
 
None.

Verze z 31. 7. 2017, 14:15

Description

Method allows You to create new download file in system.

Exact name

API_CreateDownloadFile

Type

Standard executable stored procedure.

Specification

Parameter Data type Value range Description Relation
@ValidFromDate datetime Valid from date
@ValidToDate datetime Valid to date
@GroupName nvarchar(200) Group name
@Title nvarchar(200) Title
@Description nvarchar(2000) Description
@FileName nvarchar(255) File name
@SortIndex int Sort index
@FILEDATA varbinary(max) File data

Example

Declare @fILE AS VARBINARY(MAX)
Select @fILE = CAST(bulkcolumn AS VARBINARY(MAX))
 FROM OPENROWSET(
            BULK
            'C:\test.pdf',
            SINGLE_BLOB ) AS x
			
EXEC	[API_CreateDownloadFile] @ValidFromDate = null ,@ValidToDate = null ,@GroupName= 'GroupName' ,@Title= 'Title' ,@Description= 'Description' ,@FileName= 'test.pdf' ,@SortIndex= 0 ,@FILEDATA= @fILE

Notices

None.