diff options
author | Friendika <info@friendika.com> | 2011-01-26 00:34:39 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-01-26 00:34:39 -0800 |
commit | 2fc89deaeae0341aa12b6b811927e793011055d1 (patch) | |
tree | 32673c6b92cbe14f88d955de585ce813988ec5fa /addon/js_upload/file-uploader/server/coldfusion | |
parent | abbd498a8b6c92ddcf211a27dd532f2ec6520fe2 (diff) | |
download | volse-hubzilla-2fc89deaeae0341aa12b6b811927e793011055d1.tar.gz volse-hubzilla-2fc89deaeae0341aa12b6b811927e793011055d1.tar.bz2 volse-hubzilla-2fc89deaeae0341aa12b6b811927e793011055d1.zip |
work in progress js_uploader plugin, turn java uploader into plugin - not done yet
Diffstat (limited to 'addon/js_upload/file-uploader/server/coldfusion')
3 files changed, 11 insertions, 0 deletions
diff --git a/addon/js_upload/file-uploader/server/coldfusion/coldfusion.cfc b/addon/js_upload/file-uploader/server/coldfusion/coldfusion.cfc new file mode 100644 index 000000000..4e07270d1 --- /dev/null +++ b/addon/js_upload/file-uploader/server/coldfusion/coldfusion.cfc @@ -0,0 +1 @@ +<!---
AJAX FileUploader for ColdFusion
version: 1.1.1
feedback: sid.maestre@designovermatter.com
-----------update history----------------
1.1.1 on 9/30/2010 by Martin Webb <martin[at]cubicstate.com>
- Change function for Upload to returnformat equals JSON
- local var scoping.
1.1 on 9/9/2010 by Sid Maestre
- Split Upload function to handle fallback uploads for browsers that don't support XHR data transfer
--->
<cfcomponent hint="I handle AJAX File Uploads from Valum's AJAX file uploader library">
<cffunction name="Upload" access="remote" output="false" returntype="any" returnformat="JSON">
<cfargument name="qqfile" type="string" required="true">
<cfset var local = structNew()>
<cfset local.response = structNew()>
<cfset local.requestData = GetHttpRequestData()>
<!--- check if XHR data exists --->
<cfif len(local.requestData.content) GT 0>
<cfset local.response = UploadFileXhr(arguments.qqfile, local.requestData.content)>
<cfelse>
<!--- no XHR data process as standard form submission --->
<cffile action="upload" fileField="arguments.qqfile" destination="#ExpandPath('.')#" nameConflict="makeunique">
<cfset local.response['success'] = true>
<cfset local.response['type'] = 'form'>
</cfif>
<cfreturn local.response>
</cffunction>
<cffunction name="UploadFileXhr" access="private" output="false" returntype="struct">
<cfargument name="qqfile" type="string" required="true">
<cfargument name="content" type="any" required="true">
<cfset var local = structNew()>
<cfset local.response = structNew()>
<!--- write the contents of the http request to a file.
The filename is passed with the qqfile variable --->
<cffile action="write" file="#ExpandPath('.')#/#arguments.qqfile#" output="#arguments.content#">
<!--- if you want to return some JSON you can do it here.
I'm just passing a success message --->
<cfset local.response['success'] = true>
<cfset local.response['type'] = 'xhr'>
<cfreturn local.response>
</cffunction>
</cfcomponent>
\ No newline at end of file diff --git a/addon/js_upload/file-uploader/server/coldfusion/demo.cfm b/addon/js_upload/file-uploader/server/coldfusion/demo.cfm new file mode 100644 index 000000000..98ab80030 --- /dev/null +++ b/addon/js_upload/file-uploader/server/coldfusion/demo.cfm @@ -0,0 +1 @@ +<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="fileuploader.css" rel="stylesheet" type="text/css">
<style>
body {font-size:13px; font-family:arial, sans-serif; width:700px; margin:100px auto;}
</style>
</head>
<body >
<h1>ColdFusion File Uploader Demo</h1>
<p><a href="http://github.com/valums/file-uploader">Back to project page</a></p>
<p>To upload a file, click on the button below. Drag-and-drop is supported in FF, Chrome.</p>
<p>Progress-bar is supported in FF3.6+, Chrome6+, Safari4+</p>
<div id="file-uploader-demo1">
<noscript>
<p>Please enable JavaScript to use file uploader.</p>
<!-- or put a simple form for upload here -->
</noscript>
</div>
<script src="fileuploader.js" type="text/javascript"></script>
<script>
function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('file-uploader-demo1'),
action: '/valums/server/coldfusion.cfc',
params: {method: 'Upload'}
});
}
// in your app create uploader as soon as the DOM is ready
// don't wait for the window to load
window.onload = createUploader;
</script>
</body>
</html>
\ No newline at end of file diff --git a/addon/js_upload/file-uploader/server/coldfusion/readme.txt b/addon/js_upload/file-uploader/server/coldfusion/readme.txt new file mode 100644 index 000000000..c974689aa --- /dev/null +++ b/addon/js_upload/file-uploader/server/coldfusion/readme.txt @@ -0,0 +1,9 @@ +Coldfusion example by Sidney Maestre +http://www.designovermatter.com/post.cfm/ajax-file-uploader-for-coldfusion + + 1. Unzip Andrew's AJAX Uploader into your web root. + 2. Replace the demo.htm with demo.cfm in the "client" folder + 3. Place coldfusion.cfc in the "server" folder + 4. Browse to the demo.cfm file and try it out. The file should be written to the "server" folder. + +Questions? You can contact Sidney Maestreme by mail (sid.maestre(at)designovermatter.com) or Twitter @SidneyAllen
\ No newline at end of file |