This commit is contained in:
msyu
2024-10-23 11:17:42 +03:00
commit ab5c944862
380 changed files with 55823 additions and 0 deletions
@@ -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>