ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Safecracker fails to upload files for Members group

December 02, 2011 11:34am

Subscribe [4]
  • #1 / Dec 02, 2011 11:34am

    JCDerrick

    57 posts

    Not sure what’s causing the problem, because I’ve given Members access to the channel AND the file directory (to upload files). But when I hit submit in Safecracker, it just goes to the next page and never uploads the file. Works fine for Admins, but not for Members.

    Using Safecracker File inside Matrix. I will test the field type outside of Matrix, but I still doubt it’ll work.

    Everything else works great.

    {exp:safecracker channel="placement_partner_application" error_handling="inline" author_only="yes" return="application/{embed:type}/ENTRY_ID/part_2” safecracker_head=“yes” include_jquery=“yes” id=“application” entry_id=”{embed:segment_3}”}

    {field:ppa_documentation}

    <input type=“image” src=”/images/buttons/next.png” name=“submit” value=“Next Page” alt=“Next Page”/>

    {/exp:safecracker}

    Any ideas?

    Thanks,
    John

  • #2 / Dec 02, 2011 11:40am

    JCDerrick

    57 posts

    Just discovered something even stranger. It turns out I CAN upload images, just not other files (like PDF).

    Could this be a bug? I’ve definitely got my settings right in the back end to allow all file types.

  • #3 / Dec 04, 2011 7:49am

    Sean C. Smith

    3818 posts

    John,

    In the upload directory preferences have you allowed members to upload to that directory? Are you getting any errors when uploading files other than images? Is the PDF file very large?

    Sean

  • #4 / Dec 04, 2011 9:21am

    JCDerrick

    57 posts

    Hi Sean,

    Under the preferences menu I have indeed selected “Yes” for the Members usergroup. I even created a brand new directory and did the same to make sure it wasn’t a folder permissions issue.

    I do not receive any errors when uploading an image (JPG or PNG) using Safecracker, but when I try and upload a PDF (it’s fairly small), nothing uploads.

    It’s got me stumped honestly.

    I tried this on a standalone Safecracker file and the same thing occurred.

  • #5 / Dec 05, 2011 6:12am

    Davor

    114 posts

    I have some similar issues, but I can’t upload neither image or pdf (all types), user is super admin, in EE works fine, but in safecracker everything updates besides file field (in matrix, but it’s the same in simple file) :( The time necessary for uploading is right, short for small size and longer for bigger files, but file is never saved on the location :(

  • #6 / Dec 05, 2011 1:33pm

    Adrienne L. Travis

    213 posts

    I am having the same problem. It also affects Matrix uploads in the back-end if you are using a Safecracker File field. Note that NON-Matrix file uploads seem to work fine, however! (Though I haven’t actually tried a PDF outside of Matrix, so it may be that only image uploads work.)

  • #7 / Dec 06, 2011 10:49pm

    Dan Decker

    7338 posts

    Hi JCDerrick, All,

    If I’m not mistaken, the SafeCracker File field type and Matrix aren’t compatible, but you’ll all need to check with Pixel & Tonic on that. Now that it isn’t working *outside* of Matrix *is* an issue for us.

    Can I get you all to report back with your ExpressionEngine version info? If you aren’t already using 2.3.1, and if possible, please update.

    OK, a couple of things for you all to check. Verify that all of your Upload Destinations are working properly in the Control Panel via the File Manager. Double check all file types if that is your preference. Then, let’s try using the standard File field type instead of the SafeCracker File field type. Make sure to test this out side of a Matrix field, just to be sure. Can you upload all desired file types via the standard file field type using SafeCracker?

    Thanks!

  • #8 / Dec 07, 2011 12:07pm

    JCDerrick

    57 posts

    I am using the latest version of EE. I am also using the latest version of Pixel and Tonic’s Matrix. And Safecracker files DOES work inside Matrix, I’ve used it on other sites without any problems on the backend; just not in this exact situation on the front end.

    I have tried putting a stand along Safecracker file field OUTSIDE of Matrix and now when I hit submit the page just refreshes and the PDF file doesn’t upload. This again, ONLY seems to happen for PDF files. I can upload a .docx or image just fine.

    This really has me stumped. Everything seems to work except PDF files.

  • #9 / Dec 08, 2011 4:09pm

    Dan Decker

    7338 posts

    Hi JCDerrick,

    If you strip this down to a super-simple version of your form, what happens? Make a test channel with just the SafeCracker file field type and try it in a bare-bones template and see if PDFs are allowed to upload. If the PDF still won’t go, then we likely have a bug here and we’ll get the Devs in on this.

  • #10 / Dec 10, 2011 5:18pm

    JCDerrick

    57 posts

    Hi Dan,

    Here’s what I’ve tried and this gets a little weirder on my end. The test worked.

    1.) Created a new channel called ‘Testing’
    2.) Created a new field group with a field called ‘testing’ that included one SafeCracker file field (I also tucked it inside Matrix with no problems)

    I used the SAME Safecracker code I used in my other setting:

    {exp:safecracker channel="testing" error_handling="inline" author_only="yes" return="testing/ENTRY_ID" safecracker_head="yes" include_jquery="yes" id="application" entry_id="{segment_2}"}
    
    <input type="hidden" name="title" id="title" value="Testing Entry" />
    <input type="hidden" name="url_title" id="url_title" value="testing_entry" />
    <label for="url_title" class="error">/label>
    
    <strong>PLEASE SELECT THE FILE TYPE AND DOCUMENT:</strong>
    {field:testing}
    </span>
    
    <input type="image" src="/images/buttons/next.png" name="submit" value="Test This" alt="Next Page"/>
    
    {/exp:safecracker}

    So now I’m confused… why would it work in this environment, but not in the other? No matter what I try, a regular Member account can not upload a PDF, but can upload any other file they want. As an Admin, I can upload anything, including a PDF.

    Very strange… any ideas?

    Thanks,
    John

  • #11 / Dec 12, 2011 4:22pm

    Dan Decker

    7338 posts

    John,

    Have you made sure you have All file types allowed for the Upload Destination as well as for the *file field type* in the Channel Fields for this channel? You can restrict file types in both locations. Just making sure that’s set priorly in both places. I’m working on replicating this to see if there is a bug.

  • #12 / Dec 12, 2011 4:27pm

    JCDerrick

    57 posts

    It’s set to all file types in both locations, which is why I think it allows me to upload word documents, etc.

    PDF is the only file (so far) I’ve found it doesn’t work on. Just tested it again and still the same result.

    Thanks for your help,
    John

  • #13 / Dec 12, 2011 4:34pm

    Dan Decker

    7338 posts

    I just finished my testing and I wasn’t able to replicate.

    I set up a new user in the stock Members group, made sure they had permission to upload to the directory, and successfully added an entry and uploaded a PDF as that user. Can we go in and have a look at this? I can keep offering you ideas to try, but I think we should get eyes on this. Be on the lookout for an email from me.

    Thanks!

  • #14 / Jan 05, 2012 9:26am

    JCDerrick

    57 posts

    Hi Dan, sorry for the delay getting back to you. I received your email, but it says multiple times “DO NOT Reply” to this email.

    Can I assume if I email you the login information for the site it’ll get to you OK?

    This one is a mystery to me still. I’m starting to think some permissions got crossed somewhere.

  • #15 / Jan 05, 2012 9:28am

    Dan Decker

    7338 posts

    Hey John,

    If you’ll look in that email, you will see a link to a secure form that will get your login details into our workflow behind the scenes. Sending them via regular email isn’t a very secure way to do it, hence the warnings not to reply directly.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases