Copied to clipboard

Flag this post as spam?

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


  • Bartosz Ladziński 20 posts 154 karma points
    Dec 31, 2015 @ 12:16
    Bartosz Ladziński
    0

    Courier transfers uploaded images to a wrong location (local fs instead of custom one)

    I have noticed that when transferring media items with Courier from one instance to another, all of the actual images are created on the local machine instead of our hosting service (CloudFiles on Rackspace).

    Tried to fix this issue by creating an alternative DataResolver for Umbraco.UploadField, but to no avail. When the item is packaged I get the Stream containing the image and save it to the item's resource's ResourceContents with the intention of creating the file manually using our custom CloudFiles file system, but when it arrives on the other instance, ResourceContents is just an empty byte array.

    public override void Packaged(Item item)
    {
        ...
        var test = item.Resources.Where(r => r.ExtractToPath == str1).FirstOrDefault();
        test.ResourceContents = ReadToEnd(fs.OpenFile(str1));
        // Read to End converts Stream to byte[], at this moment the ResourceContent in Resource within the item is filled with the image converted to byte[]
    }
    
    public override void Extracting(Item item)
    {
        var s = item.Resources[0].ResourceContents; //there's only one resource, the same that was packaged and at this point ResourceContents is always an empty byte array.
    }
    

    Is there a way to force Courier to use custom file provider or fix this issue in any other way?

  • Bartosz Ladziński 20 posts 154 karma points
    Jan 05, 2016 @ 09:35
    Bartosz Ladziński
    0

    Anyone?

Please Sign in or register to post replies

Write your reply to:

Draft