initial
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<cfcomponent extends="taffy.core.api">
|
||||
<cfscript>
|
||||
|
||||
this.name = hash(getCurrentTemplatePath());
|
||||
|
||||
variables.framework = {};
|
||||
variables.framework.unhandledPaths = "/Taffy/examples/api_uploadImg/client";
|
||||
|
||||
</cfscript>
|
||||
</cfcomponent>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,5 @@
|
||||
<form action="/taffy/examples/api_uploadImg/index.cfm/images" method="post" enctype="multipart/form-data">
|
||||
<input type="text" name="name" placeholder="name" />
|
||||
<input type="file" name="img" />
|
||||
<button type="submit">Upload</button>
|
||||
</form>
|
||||
@@ -0,0 +1,20 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/images">
|
||||
|
||||
<cffunction name="post">
|
||||
<cfargument name="img" />
|
||||
<cfargument name="name" />
|
||||
<cfset var local = StructNew() />
|
||||
|
||||
<cffile
|
||||
action="upload"
|
||||
destination="#getTempDirectory()#"
|
||||
fileField="img"
|
||||
nameConflict="MakeUnique"
|
||||
result="local.uploadResult"
|
||||
/>
|
||||
|
||||
<cfreturn representationOf( {args: arguments, result: local.uploadResult} ) />
|
||||
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
Reference in New Issue
Block a user