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.

HELP cant upload file with EE2.7 Channel form?

September 10, 2013 8:08pm

Subscribe [3]
  • #1 / Sep 10, 2013 8:08pm

    adamprocter's avatar

    adamprocter

    228 posts

    Updated to 2.7 and it seems that safecracker file had been automatically migrated to file (which is great better control over files via control panel but… Can seem to upload or edit files from form now ?

    Before I just had this

    {exp:channel:form
      channel="proposals"
      return="thankyou2"
      preserve_checkboxes="yes"
      include_jquery="no"
      logged_out_member_id="2" entry_id="{segment_3}" url_title="{segment_2}"}
    
    .....
    
    <input type="file" class="file" name="upload_new"/>
  • #2 / Sep 11, 2013 5:00am

    adamprocter's avatar

    adamprocter

    228 posts

    Ok it appears now for this all you need to do is include

    {field:name_of_file_field}

    But you have less control it seems - on front end I don’t want undo or remove (does not seem to work anyway) and I don’t want to show existing files on front end but I do on back ?

    Im also including JQuery but in the footer, so I am unable to load it before the form… It looks like it has an undo and remove when you let it include its own… was hoping this would provide upload bar ? but I think I must still be doing something wrong

  • #3 / Nov 04, 2013 11:58pm

    PhilBrienesse's avatar

    PhilBrienesse

    185 posts

    Found your post while trying to deal with similar issues and it was of some help. I see this is quite old so maybe you have figured things out. Anyway thought I would help you with your jquery issue. If you include jquery in the footer it will load after the forms javascript causing errors (as you pointed out) the work around I did was to use stash. In your channel:form call set include_jquery=“no” and include_assets=“no” then within the form use stash to store the assets javascript like so.

    {exp:stash:set name="saef_assets"}{channel_form_assets}{/exp:stash:set}

    Then in your footer after your jquery call output the assets javascript.

    {exp:stash:get name="saef_assets"}

    Does the trick for the javascript issue. The rest of it I am still having issues with. Mostly I cant figure out why it starts off with a picture of a file and the option to delete that and the undo remove all showing at once. You would expect something more similar to the CP version which starts off with just the ‘add file’ text link.

  • #4 / Nov 05, 2013 8:14am

    adamprocter's avatar

    adamprocter

    228 posts

    thank you, I need to revisit this as I am still not so pleased with some of the options I need for Channel Form - but it does work…

  • #5 / Mar 15, 2015 3:13pm

    trishbould

    1 posts

    I have had to come back to this 2.9.2 now
    And I would like to remove the graphic and the undo remove option from upload ?

    https://www.dropbox.com/s/zk3ihx0djo7ruee/Screen Shot 2015-03-15 at 19.12.11.png?dl=0

    Also I am not sure how to get checkboxes to work now ?

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

ExpressionEngine News!

#eecms, #events, #releases