[CB 4.0] Uploading file from form

26 views
Skip to first unread message

Benson Myrtil

unread,
May 22, 2015, 9:21:54 AM5/22/15
to col...@googlegroups.com
Good morning,

I am hoping someone can help out with this issue. I have a basic form that uploads a file:

<form action="[Insert Link]" class="" method="post" enctype="multipart/form-data">
    <input name="file" type="file" multiple />
    <button type="submit" >Submit</button>
</form>

On submit I receive the following error: JSON serialization failure: Unable to serialize binary data to JSON

I am using CF 11.

Any ideas?

Matt Quackenbush

unread,
May 22, 2015, 9:29:29 AM5/22/15
to col...@googlegroups.com
Stack trace, please?  :-)

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/8909faae-6e9a-4a22-a248-f387bc44a03f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benson Myrtil

unread,
May 22, 2015, 9:34:37 AM5/22/15
to col...@googlegroups.com

Stack Trace:

coldfusion.runtime.JSONUtils$JSONSerializeBinaryException: JSON serialization failure: Unable to serialize binary data to JSON.
    at coldfusion.runtime.JSONUtils.serializeArrayToJSON(JSONUtils.java:843)
    at coldfusion.runtime.JSONUtils.serializeJSONBase(JSONUtils.java:389)
    at coldfusion.runtime.JSONUtils.serializeJSONMap(JSONUtils.java:532)
    at coldfusion.runtime.JSONUtils.serializeJSONBase(JSONUtils.java:397)
    at coldfusion.runtime.JSONUtils.serializeJSON(JSONUtils.java:153)
    at coldfusion.runtime.JSONUtils.serializeJSON(JSONUtils.java:128)
    at coldfusion.runtime.JSONUtils.serializeJSON(JSONUtils.java:115)
    at coldfusion.runtime.CFPage.SerializeJSON(CFPage.java:8085)
    at cfLogEvent2ecfc443845148$funcGETEXTRAINFOASSTRING.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/logging/LogEvent.cfc:56)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
    at cfConsoleAppender2ecfc1323298950$funcLOGMESSAGE.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/logging/appenders/ConsoleAppender.cfc:51)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
    at cfLogger2ecfc1329924553$funcLOGMESSAGE.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/logging/Logger.cfc:344)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2805)
    at cfLogger2ecfc1329924553$funcDEBUG.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/logging/Logger.cfc:233)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
    at cfMain2ecfc381761304$funcONREQUESTSTART.runFunction(/Users/bmyrtil/Documents/Sites/launchpad/handlers/Main.cfc:30)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2805)
    at cfEventHandler2ecfc2109180006$func_PRIVATEINVOKER.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/EventHandler.cfc:78)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
    at cfController2ecfc28905840$funcINVOKER.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/web/Controller.cfc:749)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2840)
    at cfController2ecfc28905840$func_RUNEVENT.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/web/Controller.cfc:587)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2805)
    at cfController2ecfc28905840$funcRUNEVENT.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/web/Controller.cfc:425)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
    at cfBootstrap2ecfc1843975770$funcPROCESSCOLDBOXREQUEST.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/Bootstrap.cfc:171)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2840)
    at cfBootstrap2ecfc1843975770$funcONREQUESTSTART.runFunction(/Library/WebServer/Documents/ideExtensions/coldbox/system/Bootstrap.cfc:353)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
    at cfApplication2ecfc785526729$funcONREQUESTSTART.runFunction(/Users/bmyrtil/Documents/Sites/launchpad/Application.cfc:51)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
    at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)
    at coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:279)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:455)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)
    at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
    at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:151)
    at coldfusion.CfmServlet.service(CfmServlet.java:219)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

Matt Quackenbush

unread,
May 22, 2015, 9:47:54 AM5/22/15
to col...@googlegroups.com
Thanks for the stacktrace. It appears to be happening inside a core ColdBox class, and unfortunately I don't use ColdBox so that's not of much help to me, but hopefully one of the CB folks will be along shortly and will be able to help out. :-)

Benson Myrtil

unread,
May 22, 2015, 9:48:48 AM5/22/15
to col...@googlegroups.com
Thank you for trying!

You received this message because you are subscribed to a topic in the Google Groups "ColdBox Platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coldbox/eETJ_1YOhAs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coldbox+u...@googlegroups.com.

To post to this group, send email to col...@googlegroups.com.

Benson Myrtil

unread,
May 22, 2015, 9:49:46 AM5/22/15
to col...@googlegroups.com
Thanks for trying!

Luis Majano

unread,
May 22, 2015, 10:39:17 AM5/22/15
to col...@googlegroups.com, col...@googlegroups.com
Seems you have a logger trying to log the binary incoming data. in the main handler. Check that


br...@bradwood.com

unread,
May 22, 2015, 10:40:17 AM5/22/15
to col...@googlegroups.com
Can you show us line 30 of your Main.cfc handler, which is your ONREQUESTSTART() method?  It looks like you have some debug logging that's trying to log the form scope or the uploaded file.  The error is LogBox trying to serialize binary data which I assume is the uploaded file.  
 
Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------

Benson Myrtil

unread,
May 22, 2015, 10:44:39 AM5/22/15
to col...@googlegroups.com
Thank worked! I installed the RelaxURL module which is where that came from. Thanks! Ill just add a check to skip files.

PS - Love the responsiveness of this group. Definitely looking forward to scheduling a training with you once I can get the PO approved.
...

Matt Quackenbush

unread,
May 22, 2015, 10:52:39 AM5/22/15
to col...@googlegroups.com
YAY! I knew Brad or Luis would be by soon, especially after I posted. Brad has a special alert attached to my name so that he can follow up and clean up my messes. :P

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.

br...@bradwood.com

unread,
May 22, 2015, 10:59:17 AM5/22/15
to col...@googlegroups.com
It's a special phone on my desk with a flashing red light.  Been going off all morning!  :P

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
Reply all
Reply to author
Forward
0 new messages