RESOLVED: Upload file to Sitecore 8 Media Library causes Input string was not in a correct format error

Apparently there is a bug in Sitecore 8 Update 3 (rev. 150427), when you try to upload a file that is 0 Bytes in length, you get the below exception:

Server Error in '/' Application.

Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FormatException: Input string was not in a correct format.]   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14292453   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +305   Sitecore.Shell.Applications.FlashUpload.Simple.SimpleUploadPage.OnQueued(String filename, String lengthString) +93
[TargetInvocationException: Exception has been thrown by the target of an invocation.]   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211   Sitecore.Web.UI.XamlSharp.Xaml.XamlControl.ExecuteAjaxMethod(AjaxMethodEventArgs e) +184   Sitecore.Web.UI.WebControls.AjaxScriptManager.DispatchMethod(Control control, String parameters) +423   Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +398   Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +366   Sitecore.Web.UI.WebControls.ContinuationManager.RunPipelines() +255   Sitecore.Web.UI.WebControls.ContinuationManager.OnPreRender(EventArgs e) +226   System.Web.UI.Control.PreRenderRecursiveInternal() +113   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Control.PreRenderRecursiveInternal() +222   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297
Solution: Do not upload 0 Bytes file until Sitecore fixes the bug. :)

UPDATE: Sitecore provided a resolution for the ticket: Changing the "Upload.Classic" setting to true fixes the issue.


Post a Comment

Popular posts from this blog

Decision tree for selecting the best cloud hosting option (App service, VM, Containers, Serverless)

SOLVED: Error while running Sitecore Unicorn sync for Habitat Home: System.ArgumentException: Configuration(s) requested were not defined.

Back to Basics: Fetch Solr Index Field Name for Sitecore Fields Using Solr FieldNameTranslator