Uploading files to WordPress
  • I'm evaluating MarsEdit. As a test, I tried to upload a file to my WordPress blog. The upload failed, giving this message:

    "Upload File Error
    "Can't upload file for [name of blog] because the server reported an error: Could not write file [path and file name]."

    I can upload via a separate FTP client (Transmit), but it would be nice not to have to do that. I've had the same problem with another blogging app (ecto) and with the WordPress interface running in a browser.

    Does anyone have any idea why I'm having this problem? Obviously it's not just a MarsEdit problem. Can anyone suggest a solution?
  • Hi Craig - I'm not sure but if you can send me a copy of the "RPC Log" (from the Window menu) then it might help figure it out. Send it to support at red-sweater.com. Thanks!

    As I understand it, the WordPress upload depends on a specific directory being designated as "the uploads directory." Usually problems as you describe are because the web server (running WordPress) doesn't have permission to write to the specified directory.

    Daniel
  • Thanks, Daniel. I've sent the RPC Console Log to you.

    The uploads folder has wide open permissions. It is contained in a folder contained in another folder that is password protected. Earlier I tried using the WordPress browser interface to upload after removing the password protection, but it didn't work in that case either.
  • Thanks for sending the RPC log. Indeed it indicates a failure from the server with a "500" error code, which means "Internal Server Error." Not super informative, I'm afraid.

    I'm going to be doing some testing soon on my own WordPress blog with the upload functionality. Until now, mainly because I like to keep my images and "other files" in separate directories, I haven't used the WordPress upload function. But I will set mine up to do at least do some testing, and maybe that will help me better guess what might be going wrong here.

    In the mean time, since it does sound like the problem extends beyond MarsEdit, maybe somebody with more experience will chime in.

    Daniel
  • I just tested uploading to Wordpress from MarsEdit and it worked "just fine".

    I always forget that I need to leave the "path" information as a blank, not the default "." that appears.

    Anyway - latest MarsEdit (updated this morning) and latest WordPress.

    I don't think it's a MarsEdit problem at all.
  • face said:
    I don't think it's a MarsEdit problem at all.

    I don't think it is either. I just hope someone using the forum has an idea for fixing it. Thanks for testing it for me.

    I tried leaving the path field blank (as you did) but got the same result.
  • craig: somebody suggested to me off-line that in particular the upload folder for WordPress should be "755" permissions. I'm not sure if this is a situation where WordPress maybe checks to make sure it's exactly that? Or just a good habit. But maybe it would be worth confirming that the directory is exactly that:

    chmod 755 ./myUploadDirName
  • It was set to 755. As a test, I changed permissions on that folder to 777, and I was able to upload.

    I don't think I ought to leave the folder's permissions at 777 (my Web host definitely does not think I should), but perhaps this provides some kind of clue.
  • Yes - good clues. I wonder if the "group" for your directory is set to some "web server" type process? If so you could try setting the perms to 775, which gives full permissions to the group owner as well as yourself.
  • I tried 775 (at your suggestion, thanks) and got the same error message.

    I recall (but perhaps incorrectly -- it has been quite a few months) someone with my hosting service telling me that I need to be on the LAN to be part of a group given special permissions. I think the reason he gave was that I'm hosted on a shared server. Does that make sense?
  • craigc: it doesn't really make sense all by itself. I think the condensation of your problem - the question you need answered by your hosting service is:

    "How can I configure a certain directory so that a PHP web application has write access to it?"

    Different hosts handle it differently. For instance on Pair there is a technology called "CGI-Wrap" that lets the PHP process essentially run as the owner.

    Hopefully that will be enough to get some more info from your host.

    Daniel
  • I have this problem from time to time. It always seems to be in the evening and with large files. I I wait until the next day, it someitimes help.

    --- Could be it is slower on the interenet
    --- or it come be Wordpress made a change, then fixed it by morning

    BUT, if you solve what it really is, let me know. For me it doesn't seem to be a chmong thing since it works most of the time.
    lm 27
  • Daniel, I wrote to my Web host last week and am waiting for a response.

    Librarymonkey27, nice to "hear" you again. I was wondering last week what had become of you after you stopped posting to the Nisus forums. My upload problem is a consistent one, not an on-again, off-again thing like the one you experience, so I suspect we're dealing with different issues. But I'll post any worthwhile answers that I get.
  • hello...

    not that it might solve your problem but I have a couple questions

    1) what is your operating system and computer

    2) is your blog at wordpress.com or is it on your own server (or seperate server)

    I just noticed there is a 1.1.4 version avaiable, perhaps that will be the fix
  • 1) I have a PowerBook G4 running Mac OS X 10.4.8.

    2) The blog is on a separate server.

    3) I downloaded and installed MarsEdit 1.1.4, but the problem is the same.

    I'm still waiting to hear from my Web host.
  • I am guessing most of the people reading here, like myself, can not help just because we aren't in the same situation

    me for example intel osx 10.4.9 (as of a couple hours ago), but posting to the wordpress.com site...

    I would guess if you can ftp up to the site, then you can use MarsEdit, but you need to calibrate to the site ---as you said from your web host

    good luck --- go Nisus Pro ;-)
  • My Web host says it is necessary to change the "other" permissions on the uploads folder to 7. They also say it is okay with them for me to do that, so I guess that resolves the problem.
  • You are not alone, craigc. I have changed the permissions on a test directory to 777 and yet it does not work even though I cane use it from other applications as well as FTP clients. I think the error is in Mars......

    Best regards/Bengt Falke
  • falke: It sounds like the permissions problem was solved for craigc by changing the permissions to 777, so I don't think he's seeing the same issues as you are. (Note: Setting permissions to 777 is not generally recommended, but on some hosts, it's the only option they support for giving the web server write access to the directory).

    If you want to paste or send me your RPC Console when you attempt to upload files, I might be able to help. The problem here is that ISPs tend to put restrictions on what users can do with "xmlrpc.php" and "POST" methods. So it's not safe to say "I can ftp to the directory so it's probably MarsEdit."

    But it *could* be MarsEdit, so let's try to get to the bottom of it.

    Daniel
  • THanks for your quick reply, Daniel. Can you please indicate to me where I can find the RPC console? Is it maybe the xmlrpc.php-file?
    Regards/Bengt

    Edit.... I found it:
    RPC message sent: 2007-03-16 17:51:54 +0100
    URL: http://falke.nu/xmlrpc.php
    Method name: metaWeblog.newMediaObject
    RPC reply received: 2007-03-16 17:51:54 +0100
    URL: http://falke.nu/xmlrpc.php
    Method name: metaWeblog.newMediaObject
    Status code: 200
    Succeeded: NO
    --Fault Error--
    Fault code: 500
    Fault string: Could not write file testfalke.jpg
    Request text:
    <?xml version="1.0" encoding="utf-8"?>

    metaWeblog.newMediaObject


    1


    admin


    [password]





    bits
    /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgHCAgJCg0LCQoMCggICw8LDA0ODg8OCQsQERAOEQ0ODg7/2wBDAQIDAwMDAwcEBAcOCQgJDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCABkAFIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhM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AubcnnawPEkZPWNvqpU81+EfxY+Gviv4GftB/EvwD4jSC41fTpLeaOe2Zvs95BMA0c8ZIBKsrdDyCCDyKSwsYRXO776/K45YypzPkVlofoLonjqDw94Kur69lgttPVGLQlwI5ncFgI8cK3svXB9xXzb8QfGF14++MWj3wjKLPdiCEoudsYIALH1+bJPrmvnfw/q1y/wAK7oSO0qwajAdjscKPLcZ9ute1eAIbbUPiZ4Ph85ZURy3lxncWw5Y5A9k71wqLnVjTS3aRvOpaEpvorn3s91ZeJPAyW90v2m9t8RzOCMuAcq349/pXzJ4n8MarrGq6sulaRcXkqaizCKGEsQoUDOK9e0fUrfTPFcVsxeJx5q5K5DN2DD8c132gau6tJcNA0SrIULMMb8dx7V9vi8BGvTTbs1b9dPTU+cw2MdGre17qxU0fSXXwjpS3Gh30dwLOISobc5VtgyPzor3CCSeSyhkEQwyAj8RRXjexS05vyPc9tfofYdu7EYzWtAx2HnpRRXk0zJ7mjFI6uAG4xnmvFv2gvh94V8ZfAjV/E2r6aq+J/CenzaroGsW2I7uzmtx5yqHxzGzKAyHIIJ6HmiivYWtM5ZaMt2GmWjahZSIhgZ4RKfLOMEgHA9ua/Gz9vTVrvVf+Cll7pt3sa203wRp0NvtT5mV3eY7j3O5zj0HFFFXHVx9UZT2l6HxnpUSyfDXxcHyQnkuPr5rD+Vfb3wT8G+GNP+EOgeIbTSIYtbltY2kvOTIS6ZY5J4z047UUV5OD/wB7T81+Z6GI/wB3+/8AQ7vV3A8e6ghjRkaZyVI7gjBHoee1dVps0i2drCG+TO73JJFFFff1PhPnI7o+m7RANLthk/6pe/tRRRXx7bufSrY//9k=


    name
    test/falke.jpg


    type
    image/jpeg







    Response text:
    <?xml version="1.0"?>





    faultCode
    500


    faultString
    Could not write file testfalke.jpg




  • Hi falke - so this is definitely looking to me like a server-side problem. The fact that WordPress is getting as far as *trying* to write the file, but then failing, makes me think the directory is either not configured correctly, or your server has a permissions policy that "prevents PHP/Web Server from writing to the disk." You might ask them about this.

    Out of curiosity, what is the exact setting of your "Store uploads in this folder:" field in the WordPress Options -> Miscellaneous section on your WordPress admin?

    Mine is "wp-content/downloads".

    Daniel
  • It is wp-content

    What shall I write in the path-field in the images & files dialogue? test, test/ or http://falke.nu/test that is not totally clear to me

    regards/Bengt
  • falke: on some systems, the path is used to specify a specific subfolder, but that doesn't work no WordPress. WordPress just takes the path field and prepends it to the file name, and it stores the files by date inside your upload folder.

    I suspect the problem is that you are specifying "wp-content" alone as the upload folder. Try choosing something like "wp-content/uploads" and then go make sure that directory "uploads" exists in the directory on your server, and has the expected permissions.

    I noticed that WordPress is bad about returning errors for this problem, so I modified the xlmrpc.php from the latest version (2.1.2) and I will be submitting this to them to hopefully include in future versions. If you're feeling adventurous, you can download and copy this updated xmlrpc.php file:

    http://www.red-sweater.com/marsedit/xmlrpc.php.zip

    To your wordpress installation. It will cause the failure "Could not write file" to have a more meaningful error come along with it.

    Daniel
  • Well, I have changed the setings in Wordpress to wp-content/uploads

    I have changed the rights for wp-content, wp-content/uploads, wp-content/uploads/test to 777

    but still no success.

    Regards/Bengt
  • The only other things I can suggest at this point are to get in touch with your host to see what they think about the errors, and to possibly try the updated xmlrpc.php I linked to. Sorry, the solution is not obvious here because the failure seems to be happening inside your server.

    Daniel
  • OK I cracked it.....

    In the setting I had this checkbox set:

    Organize my uploads into month- and year-based folders
    and as those folders didn't exist WP did only create the year folder but did not then had the rights to create the month and date folders.... simple but annoying!
    So when I unchecked that box and had the set the rights on the upload folder to 777 all worked. I will try to reduce those rights.....

    Thanks for your help, Daniel!

    Regards/Bengt
  • Great news! Thanks for letting us know the final outcome.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!