6

I'm getting a strange behaviour when uploading to the media library recently where Images upload but the pop-up doesn't close and an error is shown if I look in the network tab. The image actually does upload but with no height/width or alt text:

> [ArgumentException: Parameter is not valid.]   
> System.Drawing.Image.FromStream(Stream stream, Boolean
> useEmbeddedColorManagement, Boolean validateImageData) +1545584   
> Sitecore.Resources.Media.ImageMedia.GetImage() +64   
> Sitecore.Resources.Media.ImageMedia.UpdateImageMetaData(MediaStream
> mediaStream) +239   
> Sitecore.Resources.Media.JpegMedia.UpdateMetaData(MediaStream
> mediaStream) +63   
> Sitecore.Resources.Media.MediaCreator.AttachStreamToMediaItem(Stream
> stream, String itemPath, String fileName, MediaCreatorOptions options)
> +282    Sitecore.Resources.Media.MediaCreator.CreateFromStream(Stream stream, String filePath, MediaCreatorOptions options) +117   
> Sitecore.Resources.Media.MediaUploader.UploadToDatabase(List`1 list)
> +487    Sitecore.Resources.Media.MediaUploader.Upload() +155    Sitecore.Pipelines.Upload.Save.Process(UploadArgs args) +1220
> 
> 
> [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    System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35   
> Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args,
> Pipeline pipeline) +398   
> Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic)
> +366    Sitecore.Shell.Applications.FlashUpload.Advanced.UploadTarget.HandleUpload()
> +1525    Sitecore.Shell.Applications.FlashUpload.Advanced.UploadTarget.OnLoad(EventArgs
> e) +852    System.Web.UI.Control.LoadRecursive() +71   
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> +3178

This is the call made to the uploadtarget.aspx page which is returning a 500 error:

> sitecore/shell/applications/flashupload/advanced/uploadtarget.aspx?
> id=%7B487DBAD1-EFC7-4989-B0C1-1DAAAFD923F6%7D&la=en&language=en&vs=1
> &version=1&database=master&readonly=0&db=master&uploadID=851fea44-50b9-4dc3-8241-4dba5895ffe4

This has only just started happening and I'm not sure why as the permissions on the folder seem fine and we haven't updated the code that I can think would affect this recently.

Further info: Sitecore 8.1 update 2.

  • is it specific to one image format? I noticed your example uses a jpeg. I know images can be finicky when saved improperly- this was primarily a problem with Adobe if the image isn't saved for the web. It sounds like the behavior is specific to one environment. I would check the response in Fiddler across a working server vs a failing server. As a last resort, you can reconstruct the processor: <processor mode="on" type="Sitecore.Pipelines.Upload.Save, Sitecore.Kernel" /> inside of the pipeline <uiUpload>. – jrap Oct 14 '16 at 19:38
  • Does it happen with all the images? or just one or two images? – Marek Musielak Oct 14 '16 at 20:41
  • It happens on all Images I've tried, including png and gif and also happens on all environments but was all working fine previously. It's odd as I'm not sure what might have affected this. Creating a copy of the image upload pipeline is a good shout though to debug this, I might have to do so if no one has any better ideas. – Adam Seabridge Oct 15 '16 at 9:53
2

After further investigation it turns out this was an issue with a custom pipeline that was being fired and interfering with the upload of images. We added some logic to skip the pipleline during uploads and it is now working fine.

  • I think you can set your own answer as the correct answer so this drops off the "unanswered" list :) – Owen Niblock Oct 18 '16 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.