Zum Inhalt springen

Dateiupload in NodeTypes

Erstellt am 31. März 2014 · 2 Antworten · letzte Antwort am 4. April 2014

Tags: Frage

Andi87 ·

Hallo allerseits,

ich habe Probleme damit, einen Dateiupload einem eigenen NodeType hinzuzufügen.
Da es mit dem Image-Upload so gut geklappt hat, sah mein erster Versuch wie folgt aus:

'Vendor.Key:Presse':
  superTypes:
    - 'TYPO3.Neos:Content'
  ...
  properties:
    download:
      type: TYPO3\Media\Domain\Model\Document
      ui:
        label: 'Download'
        inspector:
          group: 'advanced'
          position: 20

Leider lässt sich so der Inspector nicht öffnen. Die JS-Console schmeißt diesen Fehler:

Uncaught TypeError: Cannot read property 'editor' of undefined

Anschließend bin ich auf die Eigenschaft “editor” gestoßen und habe das ausprobiert:

'Vendor.Key:Presse':
  superTypes:
    - 'TYPO3.Neos:Content'
  ...
  properties:
    download:
      type: string
      ui:
        label: 'Download'
        inspector:
          group: 'advanced'
          position: 20
          editor: 'TYPO3.Neos/Inspector/Editors/FileUpload'

So wird mir zwar im Backend ein Fileupload angezeigt, der Upload selbst schlägt allerdings fehl. Da nur Grafiken erlaubt sind.

Uncaught exception #1297759968: Exception while property mapping for target type "TYPO3\Media\Domain\Model\Image", at property path "": The given resource was not a valid image file - See also: 20140331171858654788.txt

    previousException => Uncaught exception #1336662898 in line 96 of [...]\Data\Temporary\Development\Cache\Code\Flow_Object_Classes\TYPO3_Media_Domain_Model_Asset.php: The given resource was not a valid image file

Hat jemand eine Idee, was man hier machen kann? Die Doku selbst kann ich leider nichts dazu finden.

Vielen Dank schon mal vorab.

Grüße
Andi