logo
down
shadow

Sitecore disabled Media Library search after empty result


Sitecore disabled Media Library search after empty result

By : Marcos Dias Vendrami
Date : November 21 2020, 07:31 AM
help you fix your problem So I wrote directly to Sitecore support. This is bug in 7.2 version and it's fixed in 7.5 version.
code :


Share : facebook icon twitter icon
Upload Json file items to sitecore Media Library using Sitecore Item Web API

Upload Json file items to sitecore Media Library using Sitecore Item Web API


By : user2537877
Date : March 29 2020, 07:55 AM
around this issue This post may help you. It has a helper to upload files to Sitecore`s Media Library:
http://www.sitecoreinsight.com/how-create-media-items-using-sitecore-item-web-api/
Sitecore Media Library MaxSize

Sitecore Media Library MaxSize


By : user2976600
Date : March 29 2020, 07:55 AM
should help you out You can patch in your own processor into uiUpload to check the file size for certain types, in a very similar way to this post from Mike Reynolds to restrict certain file types to be upload.
code :
public class ImageCheckSize : UploadProcessor
{       
    public List<string> RestrictedExtensions { get; set; }

    public ImageCheckSize()
    {
        RestrictedExtensions = new List<string>();
    }

    public void Process(UploadArgs args)
    {
        Assert.ArgumentNotNull((object) args, "args");
        if (args.Destination == UploadDestination.File)
            return;

        foreach (string index in args.Files)
        {
            HttpPostedFile file = args.Files[index];
            if (!string.IsNullOrEmpty(file.FileName) && IsRestrictedExtension(file.FileName))
            {
                if ((long) file.ContentLength > MaxImageSizeInDatabase)
                {
                    args.ErrorText = string.Format("The image \"{0}\" is too big to be uploaded. The maximum size for uploading images is {1}.", file.FileName, MainUtil.FormatSize(MaxImageSizeInDatabase));
                    Log.Warn(args.ErrorText, this);
                    args.AbortPipeline();
                    break;
                }
            }
        }
    }

    private bool IsRestrictedExtension(string filename)
    {
        return RestrictedExtensions.Exists(restrictedExtension => string.Equals(restrictedExtension, Path.GetExtension(filename), StringComparison.CurrentCultureIgnoreCase));
    }

    public static long MaxImageSizeInDatabase
    {
        get
        {
            return Sitecore.Configuration.Settings.GetLongSetting("Media.MaxImageSizeInDatabase", 524288000L);
        }
    }
}
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">

  <sitecore>
    <processors>
      <uiUpload>
        <processor mode="on" type="Custom.Business.Pipeline.Upload.ImageCheckSize, Custom.Business"
                   patch:before="processor[@type='Sitecore.Pipelines.Upload.CheckSize, Sitecore.Kernel']">
          <restrictedExtensions hint="list">
            <extension>.jpg</extension>
            <extension>.png</extension>
          </restrictedExtensions>
        </processor>
      </uiUpload>
    </processors>

    <settings>
      <setting name="Media.MaxImageSizeInDatabase" value="1MB" />
    </settings>

  </sitecore>
</configuration>
How to stop uploading WFFM media files in Sitecore Media library folder and get byte array of uploaded media file

How to stop uploading WFFM media files in Sitecore Media library folder and get byte array of uploaded media file


By : Tina
Date : March 29 2020, 07:55 AM
wish of those help Typically you will need to create you own 'Upload field' inherited from default wffm FileUploadField and override code responsible for handling posted files. You also might need to add custom form save action if you need to handle additionally this posted file. Also you may use idea from this post.
Sitecore media library paths

Sitecore media library paths


By : sgao88
Date : March 29 2020, 07:55 AM
help you fix your problem You may want to avoid hard coding paths to media in the rich text field. The second "dynamic link" is an important feature of Sitecore in that it keeps a connection between the media and item in the Links database. This safeguards you if you ever delete or move the media.
Since it sounds like you are importing content from an external source and you already have a means of detecting the image paths, I would recommend (if possible) that you upload the images programmatically and insert the dynamic links.
Media Library not listing any media items when browsed from Image Field of an item in content editor in sitecore

Media Library not listing any media items when browsed from Image Field of an item in content editor in sitecore


By : Heatherh
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Media Library not listing any media items when browsed from Image Field of an item in content editor. , Please see below attached screenshot -
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org