Copied to clipboard

Flag this post as spam?

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


  • Tito 314 posts 623 karma points
    Mar 21, 2016 @ 17:17
    Tito
    0

    Saving media file without adding media item to database

    I would like to store a lot of media files, but i dont want to create ids and stuff in the database, only save the file in the media directory, and get the path file, same as the upload property type does.

    Although i could do it manually, I would like to use the api to do this because of:

    • Using the api i dont have to create a new folder with a name (having to look if that folder name exists, etc).
    • Take advantage of the Azure package that saves media in Azure when using the api instead that in local media directory.

    I have tried out that if i create a new IMedia item, and set the file value, the file is saved in media folder in Azure, but i cant get the umbracoFile path until i save the IMedia in the database. Is there a way to get the path of the saved file without adding the media to the database?

Please Sign in or register to post replies

Write your reply to:

Draft