Copied to clipboard

Flag this post as spam?

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


  • Maff 141 posts 465 karma points
    May 15, 2015 @ 13:32
    Maff
    0

    "FileUploads" folder fills up my disk space

    Hi,

    I'm running Umbraco 7.2.2 on an Azure Cloud Instance, and we're uploading massive amounts of media files to it - mp3s, videos etc.

    My problem is that the "App_Data\Temp\FileUploads" is rapidly filling up the small amount of local storage we have on that instance (around 700-800Mb) and I have to manually clear that data or else the site crashes!

    Is there supposed to be an automated process that clears this folder out? Could it be a permissions thing that is preventing this process from running?

    I'm using the rather awesome UmbracoAzureBlobStorage package to store my uploaded media in Azure Storage, and thought it could be a problem with that but I haven't seen any references to that folder in the source code which is why I'm thinking it's something to do with the Umbraco core code...

    Thanks,

    Maff

  • Maff 141 posts 465 karma points
    Jun 16, 2015 @ 11:04
    Maff
    0

    Hi,

    This is still causing problems for me, and I could really do with sorting it out before I hand the project over...

    Is there something in the core that is meant to clear down this directory and is there any reasons why it wouldn't work? (App Pool identity etc?)

    Thanks,

    Maff

  • Maff 141 posts 465 karma points
    Jun 17, 2015 @ 11:00
    Maff
    0

    For anyone who is facing a similar issue, I've added a workaround to my project for this. I'm intercepting the MediaService.Saved event and adding this code to my custom method:

    DirectoryInfo fileUploadFolder = new DirectoryInfo(ConfigurationManager.AppSettings["FileUploadFolder"]);
    
    IEnumerable<FileInfo> files = fileUploadFolder.GetFiles().Where(x => x.CreationTimeUtc < DateTime.UtcNow.AddMinutes(-2));
    
    foreach (FileInfo file in files)
    {
      try
      {
        file.Delete();
      }
      catch (Exception ex)
      {
        LogHelper.Error<string>("File Delete Error", ex);
      }
    }
    

    Works fine (as long as your application has write access to the file system).

    Thanks,

    Maff

  • Jonas 123 posts 206 karma points
    Aug 31, 2015 @ 07:27
    Jonas
    0

    We have the same issue with disk filling up because if fileUploads.

Please Sign in or register to post replies

Write your reply to:

Draft