• Having worked flawlessly until now, my image uploader suddenly produces nothing but “Failed to write file to disk” errors, both the Browser uploader as well as the Flash uploader.

    The problem occurs in all browsers. Uploading audio files doesn’t work either.

    I deactivated all plugins I’d recently installed, but to no avail.

    I can still transfer images via FTP into my Uploads folder, but the WP image uplader is more convenient.

    What might be the problem?

    http://blog.cyberquill.com

Viewing 9 replies - 1 through 9 (of 9 total)
  • Permissions on that folder? Mine is set to 755

    Yes. Check the permissions, also check the upload folder path
    It’s in:
    /wp-admin/options-media.php -> “Store uploads in this folder”

    Make sure that it is set to the default since you say you are using the “Uploads” folder.
    I’ve seen people set that to another directory and then it is deleted down the road and the uploader naturally breaks.

    Hi cyberquill. Based upon what you have described, your server’s upload_tmp_dir, usually /tmp is full.

    While codex.wordpress.org doesn’t seem to have any documentation on this error, I did find in a few forums where users had the same error as yourself, and the problem was that their tmp folder had become full. They contacted their host about this, and when the host cleared the tmp folder this resolved the issue. This is why ftp works, but php uploads don’t. I’ve written more information about the WordPress Error : Failed to write file to disk error for you.

    Thread Starter cyberquill

    (@cyberquill)

    Interesting. Thank you.

    My Linux server says the following:

    All “temp” files created in the /tmp directory on our Linux servers will be deleted if they have not been accessed for 720 hours (30 days).

    Whatever that may mean.

    Anyhow, as per imh_brad’s instructions, I created a phpinfo.php page, and saw that my upload_tmp_dir value is set to /tmp.

    Then I looked at my permissions for the Uploads folder. It doesn’t have any numbers (such as 755), but there are three check boxes each (Read, Write, and Execute) next to “Web user permissions” and “Owner permissions.” The box for “Write” next to “Web user permissions” was unchecked, so I checked it.

    Now my picture uploading works again.

    However, I also deleted some pics in my WP Media Library that I don’t need. So now I don’t know whether it was checking the “Write” box or making room in my Uploads folder which fixed the problem for now.

    To check your solution, have you tested trying to upload a few images (a collection of images that takes up more space than the ones you deleted?)

    Thread Starter cyberquill

    (@cyberquill)

    I’m afraid I was paying attention neither to the number of images I deleted nor to their file sizes.

    But just in case, where exactly do I find this tmp folder on my server? Can I delete its contents myself, or do I have to call customer service and have the folks there empty it?

    Most likely the tmp folder is /tmp which you won’t be able to delete the contents.

    Some hosts allow the php exec command, and if your host does, you can put this code in a php file to view what’s in that /tmp folder:

    <?php
    
    echo "<p>SIZE OF /tmp is:\n<pre>" . exec('du -h /tmp') . "</pre></p>";
    
    echo "<p>CONTENTS OF /tmp is:\n<pre>" . exec('ls -alh /tmp') . "</pre></p>";
    
    ?>

    … all though this won’t give you all of the information you’ll need to troubleshoot.

    Thread Starter cyberquill

    (@cyberquill)

    Thanks. I created that .php file, and it gives me this page. What exactly does it tell me?

    That file shows you that the /tmp folder is 5.7M large.

    It’s also showing you that there is one directory in /tmp that you can see, and it is named views_simplecache.

    If you get the error with WordPress again regarding the upload, I would run that script again and report back with the size of the /tmp folder. I would assume that it would be much more than 5.7MB large. I also am assuming that the file size is so low because they probably just recently cleared it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Sudden image upload failure’ is closed to new replies.