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.
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.
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:
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 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.
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......
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.
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?
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:
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.
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.....