Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Last active September 29, 2015 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiejackson/3963d2bf293a46742b18 to your computer and use it in GitHub Desktop.
Save jamiejackson/3963d2bf293a46742b18 to your computer and use it in GitHub Desktop.
Throughput Difference in Form File Upload vs. cURL Upload
# 1.75 MB/s
curl 'https://mysite.com/test/testUpload.cfm?which=fileUploadAll' -F 'filedata=@/cygdrive/e/garbage/GIS Toolkit 2014/GIS Toolkit 2014/CoC_GIS_State_Tool_IN_2014.zip' --compressed --insecure --limit-rate 1000M
<!--- 0.71 MB/s --->
<cfif isdefined("form.fileData")>
<cfscript>
param name="url.which" default="fileUpload";
destination = expandPath("/mysite_deployment_root/protected/reportmanagement/inbound");
nameConflict = "overwrite";
if ( which == "fileUpload" ) {
result = fileUpload(
destination=destination,
nameConflict=nameConflict
);
} else {
result = fileUploadAll(
destination=destination,
nameConflict=nameConflict
);
}
</cfscript>
<cfoutput>#serializeJSON(result)#</cfoutput>
<cfelse>
<form name="myUpload" enctype="multipart/form-data">
<cfinput type="file" name="fileData"><br>
<cfinput type="submit" name="submit">
</form>
</cfif>
@jamiejackson
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment