Howdy, Stranger!

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

Image upload problem - Drupal 7

edited April 2014 in MarsEdit
I'm getting the following when attempting to upload images from my desktop into a ME post:

"The post could not be published because of an error while uploading an attached file: It is not possible to upload the file, because it exceeded the maximum filesize of 0 bytes.

If this problem persists, try deleting the attachment from the Uploads list, and from your post content. Then, insert the attachment again before sending to your blog."

Of course I've tried deleting and re-inserting the image ad nauseam, to no avail.
I can insert images that are already on the server just fine.

I've checked the IMCE image size limit, and went so far as to change it from 0 (unlimited) to 8 MB (as constrained by my php.ini) on the theory that perhaps the 0 was causing confusion - but no joy.

The error log is unhelpful.

On the other hand, I can insert images into posts on the site itself, via CKEditor, just fine - so I'm pretty sure that's configured properly.

But I do need to be able to send up an image via Mars Edit.
This is pretty critical for me, as I have users that will definitely not be able to FTP a whole bunch of images and then go fish them out of the filesystem hierarchy when composing a post.

Any ideas appreciated.


  • Hi Sam - unfortunately if the error is coming from the server, there isn't much you can do on the MarsEdit end except to try uploading a smaller sized image. It seems possible that the images you are uploading are exceeding some limit on your server that is separate from the configuration you're speaking of. The alternative of course would be to see if the server admins for your site can do something to increase the absolute maximum POST file size to something greater.

    The problem is uploads from MarsEdit have to go through a different route (through the API) than through the site's admin panel. It's a route that uses more memory because the image has to be converted completely to text to upload to the server through the API. I wish there were a better way to upload from MarsEdit but this is what the API offers me.

  • I have complete control of the server.
    My image is a 147kb PNG file; my upload_max_filesize is 20M, and post_max_size is 8M.
    Hard to see how I'm exceeding anything - anywhere else I can look?
  • BTW I've also posted this to the BlogAPI issue queue on; and, for what it's worth, the same issue arises with Qumana and Ecto.
  • Accepted Answer
    Hi Sam - with specific error messages like this it can sometimes be very useful to look for the specific error message in the server sources for the system (in this case in Drupal). A quick Google brought up this code excerpt from Drupal 6 which I imagine is largely the same in 7:!blogapi!blogapi.module/function/blogapi_metaweblog_new_media_object/6

    Notice how it compares the size of the file to some variables from the blogapi module configuration, like blogapi_uploadsize_$rid ... looks like there is a way to configure maximum upload sizes within the blogapi module itself.
  • That's a good idea - thanks. I'll search the module source code.
  • Well that was instructive.
    What I eventually figured out was that, as the superuser, I wasn't a member of any roles - so I didn't have a valid filesize limit. BlogAPI didn't do the right thing in this case - it assigned my user upload limit a value of 0.
    I solved the issue by creating a role, giving it the proper perms, and adding myself to it.
    Let me know if you'd like more info on this, but that's the gist of it.

    Now I have another problem - but I'll post that on d.o as it's almost certainly API-related (it's a SQL complaint "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'dfid' in 'field list'").
  • Just a quick update on that last one in case anyone else sees this - the lack of a dfid column in the blogapi_files table was rectified by uninstalling and re-installing the whole BlogAPI package.
    And I'm back to being able to post images now (yay).
    I must say this is a relief, as several of my users are quite attached to Mars Edit.
  • More great discoveries. Very interesting (annoying) situation they put the superuser into. Whoops!
  • Sam and Dan,

    I ran into these same problems (I just updated my site to D7).

    I followed the instructions on Sam's site and got all the way to the point where I got the SQL message and had to uninstall BlogAPI (and the sub-modules). I did all that and had success, I was able to access existing posts and upload an image file.

    The HTML appeared in MarsEdit but...

    It did not preview and when I tried to enter the image URL directly into a browser it did not appear.

    Any "last step" that I need to try?

  • Hi rcox1963 - I am afraid I don't know enough about Drupal to advise on this. Hopefully somebody else with more hands-on experience will come back and spot this and be able to offer some useful advice.
  • @rcox1963 - I'm unclear on what happened.
    Did you create a post with an image in it in MarsEdit, send it to your site and have it appear correctly?
Sign In or Register to comment.