We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Minimum fields required for file uploading

How Do I?

vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

I have created my channel. I have added a file upload field. Furthermore, I can upload files fine from the admin control panel.

I created a channel form in a template. Users can submit entries fine.

Now I want to let those users upload files on the channel form.

What are the minimum fields required for this?

This alone does not work. Nothing gets uploaded to the folder while I submit the form:

<input type="file" name="my_files" />

my_files = is the actual Field I created for file uploads in that channel.

       
vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

It seems after reading this: https://expressionengine.com/forums/topic/253034/how-remove-replace-edit-file-in-channel-form

All I need is to create one field such as: {field:my_files}

The documentation related to channel forms is completely different. Its talking about hidden field names and directories.

       
vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

After testing with that field and checking the source code, I see what is wrong. The documentation is a complete mess.

It seems value=”1” is the actual ID of the upload directory. Not the directory name like it says in the documentation.

The part it talks about hidden files and directories, you actually need to append _hidden_dir to the field name, not just use the field name or the upload directory name.

The documentation needs serious fixes with proper examples here.

       
vw000's avatar
vw000
482 posts
4 years ago
vw000's avatar vw000

I figured this out already after testing and playing around. What I did not figured out so far is how to allow multiple files to be uploaded in one POST submit without having to use the grid file (which I don’t need right now).

It seems if I create several file upload fields, it will just upload one file even if you manually select more than one with the browser file picker.

Or do I need to create more file fields in the channel for this?

       
stereoi123's avatar
stereoi123
35 posts
4 years ago
stereoi123's avatar stereoi123

Hello! I am currently experiencing very similar issues with the channel form file upload field and was hoping you could shine a light on things for me. I am using a manually constructed file field to allow non-logged-in users to create a new channel entry. They do not need editing capabilities.

Everything on the form is working fine except the file upload field. This is the code I am currently using - based somewhat on information in your post:

<label for=”upload_drawings”>Upload A File (DOC, PDF, JPG, PNG)</label>

<input type=”file” class=”form-control” id=”upload_drawings” name=”upload_drawings” accept=”.doc,.docx,.pdf,.jpg,.jpeg,.png,.gif”>

<input type=”hidden” name=”estimate_uploads” value=”13” />

File Field Short Name: upload_drawings

Upload Directory Name: Estimate Uploads

Upload Directory ID: 13

I am using EE Ver. 5.4.2

Any help would be greatly appreciated!!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.