Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File upload (defined in blueprints) #13

Closed
kroegerama opened this issue Aug 6, 2015 · 2 comments
Closed

File upload (defined in blueprints) #13

kroegerama opened this issue Aug 6, 2015 · 2 comments

Comments

@kroegerama
Copy link

I have defined the following in the blueprints file of my theme (/user/themes/mytheme/blueprints/default.yaml) to add a new tab "Downloads" to each page's admin panel:

form:
  fields:
    tabs:
      type: tabs
      active: 1
      fields:
        downloads:
          type: tab
          title: Downloads
          fields:
            downloads:
              type: section
              title: Downloads
              underline: true
            header.downloads:
              type: list
              label: Downloads
              fields:
                .title:
                  type: text
                  label: Title
                  default:
                  validate:
                    required: true
                .file:
                  type: upload
                  label: File
                .icon:
                  type: text
                  label: Icon
                  default:
                  validate:
                    required: false

This works fine and the new tab is displayed. However, if I click on "save", the file won't upload and the page header contains:

file: 'C:\fakepath\test.bin'

The fakepath part is a security feature of Chrome. Grav should only use the last part of the filename.

(I'm not sure, if this is a problem with the admin plugin or with the forms plugin. Sorry, if I'm wrong here.)

@rhukster
Copy link
Member

rhukster commented Aug 6, 2015

The form's plugin is still very much a beta. In fact that upload field is not even tested yet.

The admin has it's own field overrides, and frankly it's just relying on the forms engine to power the admin forms.

Please move this issue to the forms plugin issues list so we can keep track of things as we flush out the features of each plugin.

@rhukster rhukster closed this as completed Aug 6, 2015
@kroegerama
Copy link
Author

Okay, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants