自定义向导插件上传问题

You’ll want to do 2 things here, which are independent of making changes to the custom-wizard plugin.

1 Create a theme component which overrides the wizard-field-image.hbs template in core (it’s not in the custom-wizard plugin) [Note that we’re doing this to change the ‘accept’ field in the input, unfortunately there’s not a less obstrusive way to do this at this time that I’m aware of]

<script type="text/x-handlebars" data-template-name="wizard/templates/components/wizard-field-image">
  {{#if field.value}}
    {{component previewComponent field=field fieldClass=fieldClass wizard=wizard}}
  {{/if}}

  <label class="wizard-btn wizard-btn-upload {{if uploading 'disabled'}}">
    {{#if uploading}}
      {{i18n "wizard.uploading"}}
    {{else}}
      {{i18n "wizard.upload"}}
      {{d-icon "picture-o"}}
    {{/if}}

    <!-- Note the addition of application/pdf here-->
    <input disabled={{uploading}} type="file" accept="image/*,application/pdf" style="visibility: hidden; position: absolute;" />
  </label>
</script

2 Add ‘pdf’ to the list of authorized extensions in your settings

Be aware that letting people you don’t trust upload pdfs is a dangerous thing.

You might need some additional finagling to display an acceptable preview / placeholder image, since the uploader thing will try to display an image preview and that won’t work

that’s out of scope of my free tier, though :blush: