Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • René Andersen 238 posts 684 karma points
    Sep 25, 2015 @ 14:00
    René Andersen
    0

    Media upload problem

    Hi everybody,

    UPDATE: I found a solution, but it is a bad solution. First I upload the images and then I have to visit the media folder and click save on each image again. Does anybody know why I have to save again?

    This code below works perfectly on a localhost, but as soon as i put it online it does not work.

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "SiteLayout.cshtml";
    
        var items = CurrentPage.Children;
    }
    
    <div id="main" role="main">
        <div id="main-content">
            <div class="container">
                <div class="row portfolio-boxes" id="portfolio-container">
                    @foreach (var pictures in items)
                    {
                        if (pictures.HasValue("galleryImages"))
                        {
                            var ImagesList = pictures.galleryImages.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                            var ImagesCollection = Umbraco.Media(ImagesList);
    
                            foreach (var Image in ImagesCollection)
                            {
                                <div class="col-sm-4 portfolio-box @pictures.Name.ToLower().Replace(" ", "_") portfolio-item">
                                    <a data-lightbox data-lightbox-gallery="lightbox-test" href="@Image.Url">
                                        <div class="image-link">
                                            <i class="fa fa-search"></i>
                                            <img class="img-responsive img-rounded center-block" src="@Image.Url" alt="@Image.Name" width="360" height="235" />
                                        </div>
                                    </a>
                                </div>
                            }
                        }
                    }
                </div>
            </div>
        </div>
    </div>
    

    The HTML output on the online page looks like this:

    <img class="img-responsive img-rounded center-block" src="" alt="Georg-8.jpg" width="360" height="235" />
    

    As you can see then the image src is missing.

    Can anybody tell me what I am doing wrong? I have deleted the TEMP files regarding "FileUploads" before i uploaded the site.

    I am thinking maybe deleting all media files and folders and start from scratch, but I am not sure if that will help me out.

    Thanks in advance!

    // René

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Sep 25, 2015 @ 14:29
    Dennis Aaen
    0

    Hi René

    Try to see here you should be able to get the source back by re-save the images

    https://our.umbraco.org/forum/ourumb-dev-forum/bugs/40175-img-src-empty-after-upgrade-to-602-re-saving-media-restoresSOLVED

    Maybe you can use the url to do it all in once.

    Hope this helps,

    /Dennis

  • René Andersen 238 posts 684 karma points
    Sep 25, 2015 @ 17:11
    René Andersen
    0

    Hi Dennis,

    Unfortunately that did not work, and now I can't even save twice to get it working. I have tried to delete browser cache and republish entire site. Nothing works.

    Should the folders (1001, 1002 etc.) inside the media folder have the same number as the ID in the image properties?

    UPDATE: Looks like I am not the only one with the problem, see:

    https://our.umbraco.org/forum/developers/razor/57936-TypedMedia-URL-is-empty

    enter image description here

    // René

  • René Andersen 238 posts 684 karma points
    Sep 25, 2015 @ 23:04
    René Andersen
    0

    Problem solved.

    Upgraded from Umbraco version 7.2.6 to 7.2.8.

    I wish I had done that ealier. :-)

Please Sign in or register to post replies

Write your reply to:

Draft