Image upload problem - Drupal 7
  • 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.

    Daniel
  • 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 drupal.org; and, for what it's worth, the same issue arises with Qumana and Ecto.
  • Daniel JalkutDaniel Jalkut
    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:

    https://api.drupal.org/api/drupal/modules!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!
Start a New Discussion

Howdy, Stranger!

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