I get 'no disk space' error trying to create a file

Discussion in 'ASP.NET 2.0' started by msd59, Apr 8, 2009.

  1. Hi All,

    I'm sure this is a doh! but I can't find it.

    I'm using this code (filename changed for clarity)

    string docpath = Server.MapPath("~/thepath/thedoc.txt");
    StreamWriter sw = new StreamWriter(docpath);

    its throwing the error "no disk space".

    I verified that anonymous has write access to the directory and, of course that the account has plenty of disk space.

    I also verified that if the file already existed I can overwrite it, so its creating it that cause the problem.

    Is there a checklist or something I can use to diagnose this?

    thanks!

    john
     
  2. Did you assign the correct disk quota space to the IUSR?

    If your web application is an asp page, you will need to assign the disk quota to 'Anonymous IUSR'. If it is a .Net application you will need to assign disk quota space to 'ASPNet IUSR'. You should be able to see this inside your hosting control panel under 'User/Quota Manager'.
     
  3. hi,

    I had the same problem, and fixed it as recommended by this thread. Thankyou!

    However, I only became aware of the problem after my web site failed, and several users reported a problem, and, after diagnosis, I worked out this disk space problem.

    Can I suggest that if the quota is exceeded, that a message be sent to the account owner immediately, so that they can attend to it quickly? Even better, please send a message *before* the quota is exceeded.
     
  4. We do not have an official tool/feature that will warn you if your disk space is low but we do have some open API's that you can use to have you notified if certain parameters in your account is reaching a specific threshold. One of them is the Disk Usage.
    Bare in mind that this can require a great deal of knowledge of coding. I suggest you look at this threads from our community forum. One of the threads has a test API application that can monitor your Disk Usage.

    http://community.discountasp.net/showthread.php?t=3522&highlight=Disk+Usage
    http://community.discountasp.net/showthread.php?t=3527&highlight=Vikram
     

Share This Page