CLI sync / upload_dir fails to upload images

Comments

7 comments

  • Avatar
    Mo Ip

    Hi endjin,

    Please refer: https://cloudinary.com/documentation/cloudinary_cli#sync on how to syn assets between a local directory and your Cloudinary account directory.

    Here is an example:

    my local directory is: /Users/moip/Desktop/ticket_120834/images/blog/2013/03

    and my Cloudinary directory is set up as: blog/2013/03

    moip@Mos-MBP-2 03 % cld sync --push "/Users/moip/Desktop/ticket_120834/images/blog/2013/03" "blog/2013/03"
    Found 2 items in local folder '/Users/moip/Desktop/ticket_120834/images/blog/2013/03'
    Found 0 items in Cloudinary folder 'blog/2013/03'
    Uploading 2 items to Cloudinary folder 'blog/2013/03'
    Successfully uploaded /Users/moip/Desktop/ticket_120834/images/blog/2013/03/rustic.jpeg as blog/2013/03/rustic
    Successfully uploaded /Users/moip/Desktop/ticket_120834/images/blog/2013/03/beauty.jpeg as blog/2013/03/beauty

    Regards,

    Mo

    0
    Comment actions Permalink
  • Avatar
    endjin

    Hi Mo,

    Thanks for the quick response. I believe I was using the CLI correctly. I've tried it again, and still the same problem.

    I'm wondering why I'm getting the following error:

    error: Failed uploading C:\Temp\images\blog\2013\03\IMG_06481.jpg, error: public_id (2013\03/IMG_06481) is invalid.

    What's making me suspicious is the final bit:

    public_id (2013\03/IMG_06481) is invalid.

    I would expect the public_id to be (2013\03\IMG_06481) not (2013\03/IMG_06481) (note the difference in the final slash).

    0
    Comment actions Permalink
  • Avatar
    endjin

    I'm also slightly suspicious that this is a "path" bug with Windows - If I look at your example

    moip@Mos-MBP-2

    I take it you are trying this on a MacBook Pro?

    0
    Comment actions Permalink
  • Avatar
    Brian Luk

    Hi Endjin - thanks for bringing this to our attention!

    I've implemented a fix in the GitHub repository on the `fix/windows_path_format` branch here. Note that in order to match Cloudinary's folder syntax, `2013\03\IMG_06481` should now be uploaded as `2013/03/IMG_06481` rather than keeping the Windows folder separator `\`.

    Could you try installing the fixed version from the repository and let me know if it solves your issue?

    git clone -b fix/windows_path_format https://github.com/cloudinary/cloudinary-cli
    pip3 install -e cloudinary-cli
    0
    Comment actions Permalink
  • Avatar
    endjin

    Hi Brian,

    just trying it out.

    I've also just issued a PR to add guidance for setting up the CLI in PowerShell (the "set" command behaviour is different than using cmd.exe).

    https://github.com/cloudinary/cloudinary-cli/pull/14

    Regards,

    Howard

    1
    Comment actions Permalink
  • Avatar
    endjin

    Yay! That works. Thanks very much for the quick turnaround.

    Regards,

    Howard

    0
    Comment actions Permalink
  • Avatar
    Brian Luk

    Hi Howard,

    Glad it works, and thanks for the pull request! I went ahead and merged it.

    Best,

    Brian

    0
    Comment actions Permalink

Please sign in to leave a comment.