How to create Upload field?

Hello. I’m stuck in creating upload field in panel, sorry for some noob question there.

I’ve “created” field in my yml like this:

          steam_image:
            label: Select files...
            type: files
            multiple: false

But there is “Select” button instead of “Upload”, and I cannot understand, what should I do to create upload fields to my pages.

Thank you for any advance!

For uploading, you have to create afiles section instead of a Panel field. Upload functionality for the files field is planned for 3.1

Yeah, I’m understand now, thank you very much :slight_smile:

I need to create something like this:

      image_uploads:
        type: files
        fields:
            images:
              type: files

No, a files section doesn’t have fields.

Basic example:

sections:
  gallery:
    type: files
    headline: Gallery images

Check the documentation for details.

Now I’m understand, thank you.

I need to create one upload section and as many file fields as I need.

Then I need to upload files to upload section and then select them in my fields from uploaded files list.

I still don’t understand, how it works, for example I have this blueprint:

sections:

  files:
    extends: sections/files

then in files.yml it’s:

headline: Files
type: files
template: image

and it’s works as file UPLOAD:
upload

but when I do similar:

     label: Citatos
    type: builder
    fieldsets:
      imglist:
        label: Images List
        fields: 
          imglistimg:
            label: Sąrašo nuotrauka
            type: files
            template: listimg
            max: 1
          imglisttextarea:
            label: Aprašymas
            type: textarea
          imglisttitle:
            label: Antraštė
            type: text

then in last example it works as file SELECT. So why it’s analogical code in blueprints, but works different?

If it’s only possible as section, @texnixe, can you help how to change select to upload in this blueprint? Don’t understand where to put section here:

label: Builder
type: builder
fieldsets:
  imglist:
    label: Images List
    fields: 
      imglistimg:
        label: Sąrašo nuotrauka
        type: files
        template: listimg
        max: 1
      imglisttextarea:
        label: Aprašymas
        type: textarea
      imglisttitle:
        label: Antraštė
        type: text

There are files sections (for uploading) and files fields (for selecting). In the latter case, you have defined a field. In a field, you can currently only select files. Uploading for files fields will come in 3.2

You can’t have a section in a fieldset.

1 Like

I see, will it be possible in version 3.2?

In 3.2 the files field will get an upload option, similar to what we now have in the textarea field. It will not be possible to add a files section in a builder fieldset.