
895
DEVELOPING
COLDFUSION 9 APPLICATIONS
Office file interoperability
Las
t
upda
te
d 8/5/2010
<cfsharepoint
action="addlist"
login="#login#"
params="#{ listname ="getpics",
description="This a picture library list",
templateId= "109 " }#"/>
<! --- Creates a folder within the picture library list>
< cfsharepoint
action ="create new folder"
login= "#login#"
name="collection1"
params="#{strListName="getpics",
strParentFolder=""}#"/>
<!--- Uploads pictures to the folder that you created --->
<cfscript>
myimage = filereadbinary(expandpath("Bird.jpg"));
//convert the image into byte array to pass as input for "upload" action.
</cfscript>
<cfsharepoint
action="upload" login="#login#"
params="#{strListName="testpics",
strfolder="Collection1",
bytes="#myimage#",
filename="bird.jpg",
fOverwriteifexist=true}#"/>
<!--- Rotates the picture downloaded from the SharePoint server.--->
<cfsharepoint
name ="result1"
action="download"
login="#login#"
params="#{strListName="getpics",
strfolder="New Folder",
itemFileNames=["bird.jpg"],type=1,
fFetchoriginalIfNotAvailable=true}#"/>
<cfimage
action="rotate"
source="#result1.file#"
isbase64="yes"
angle="45"
name="temp"
destination="bird.jpg"
overwrite="yes"/>
<cfscript>
baseimage = filereadbinary(expandpath("bird.jpg"));
//convert the image into byte array to pass as input for "upload" action.
</cfscript>
<!--- Uploads the rotated image back to the SharePoint server --->
<cfsharepoint
action="upload"
login="#login#"
params="#{strListName="getpics",strfolder="Collection1",
bytes="#baseimage#",filename="bird.jpg",fOverwriteifexist=true}#"/>
To check and ensure that all the updates are made, you can retrieve the list items using code like the following:
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...