3

Got a client who uses his iPhone and iPad to update his site (he doesn't have a laptop!). Craft does a much better job than most as a mobile CMS, but he's running into issues with file uploads. When uploading from his Camera Roll he gets the following:

Upload failed for image.jpg. The error message was: "Error uploading the file: This file type is not allowed"

I've tried too and get same response. In config.php jpeg and jpg are set in allowedFileExtensions, and maxUploadFileSize is ample if that matters. Wondering if there's some weird proprietary stuff with iOS files that's causing this? Anyone else experienced this before?

  • Also check your field settings to make sure 'Images' are selected under the allowed file types option. – Jamie Wade Jul 31 '15 at 8:27
  • Hi Jamie. Yep, definitely set to 'Images' already. – Ian Ebden Jul 31 '15 at 9:17
  • FWIW, I'm not able to reproduce this locally. Not that it should matter, but can you try removing the allowedFileExtensions (jpg is allowed by default) and maxUploadFileSize config settings just to narrow things down? – Brad Bell Jul 31 '15 at 16:27
  • Hi Brad. Yeah tried that too. Wonder if it's a host thing? I'll drop them a line and see what they suggest. – Ian Ebden Aug 3 '15 at 8:35
  • @IanEbden did you ever solve this? I'm having the same issues for a client. – naboovalley Oct 6 '15 at 6:46
2

Update: This bug is fixed as of Craft 2.4.2697

Images uploaded from iOS now get renamed to “image_YYYYMMDD_HHMMSS.ext” (from “image.ext”), fixing a bug where iOS uploads would fail after the 51st image due to Craft’s limit on allowed same-name uploads.

iOS uploads images from the camera roll with the name image.jpg, and if this happens multiple times then an incremental number is appended to the filename, similar to what happens with slugs. I have found that after 50 such instances though, the error message you reported starts to appear and images cannot be uploaded.

This is a bug in Craft and P&T will hopefully release a fix soon, but a temporary solution is to rename some uploaded files so that the 50 limit is not reached. Alternatively, you could make the entry slug part of the upload path to avoid reaching the limit.

| improve this answer | |
  • 1
    To avoid the renaming maybe you could make the entry slug part of the upload path? That way you would only hit the wall if there are 50 img per entry. Could make life with all the image.jpg files easier as well. – Wolfram Gehring Oct 10 '15 at 23:18
  • That's right, I've added your suggestion to the answer, thanks!! – Ben Croker Oct 11 '15 at 7:16
  • Ah of course! Well spotted Ben. Okay, I think my client will sit tight for a Craft update on this one. – Ian Ebden Oct 12 '15 at 9:40
  • Thanks @BenCroker for adding my suggestion,the latest Craft version (2.4.2697) however makes that obsolete. The problem should be history now. – Wolfram Gehring Oct 15 '15 at 21:16
  • yup cheers, added that too – Ben Croker Oct 16 '15 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.