Copied to clipboard

Flag this post as spam?

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


  • Khupi 7 posts 117 karma points
    Mar 30, 2022 @ 09:20
    Khupi
    0

    Media subfolder id unable to convert from string to int

    media subfolder value -1,37738 cannot convert to int, anyone with a solution?

    umbraco V8

  • Ambert van Unen 175 posts 817 karma points c-trib
    Mar 30, 2022 @ 14:41
    Ambert van Unen
    100

    Well an integer is always a full number, so you cannot parse '-1,37738' to an int.

    I'm not sure what you want to do, but you can always parse to a float if you need it in that format?

  • Khupi 7 posts 117 karma points
    Apr 01, 2022 @ 12:42
    Khupi
    0

    Hi @ Ambert

    I got the solution, I discovered that i shouldn't be passing -1, I only find out that I need to only pass the id. thanks for your input.

    var media = _mediaService.CreateMediaWithIdentity(filename, 37738, mediaType);

    this is the correct way of doing it!!!

  • Khupi 7 posts 117 karma points
    Apr 01, 2022 @ 12:15
    Khupi
    100

    I want to pass this value to this method to save the file inside a specific subfolder using the subfolder path value.

    var media = _mediaService.CreateMediaWithIdentity(filename, -1,37738, mediaType);

    parameter takes an integer only

Please Sign in or register to post replies

Write your reply to:

Draft