I am having some trouble uploading GLTF files into kirby. I’m trying to make a three.js viewer.
When I try to upload into the files field, I get the error messaage
“The media type for “xxxx.gltf” cannot be detected”
I’ve made sure all file types are accepted in the file blueprint but it doesn’t seem to be changing anything.
Guess you are asking because it doesn’t work? You probably have to use one of Kirbys existing file types (document, image, video, archive, audio, code) or add new filetypes. If you use image, for example, it will upload.
Hello, I just want to follow up on this since I have not been able to upload 3d files as well.
I am also trying to create a file section to upload GLB/ GLTF files via the panel.
After trying to register a new GLB file type, I still get an error “Call to a member function template() on null” with a failed upload.
The first one gave met the url I need, but I need to have more models one one page,
so I can’t really use it this way. The second one throws an error. ‘Array to string conversion’.
So I guess my question is:
How do I get the url of the model from a files field into the page? (in this case ''model())
Whoops\Exception\ErrorException thrown with message "Array to string conversion"
Stacktrace:
#48 Whoops\Exception\ErrorException in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/Field.php:226
#47 Whoops\Run:handleError in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/Field.php:226
#46 Kirby\Cms\Field:toString in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/Field.php:126
#45 Kirby\Cms\Field:__toString in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/site/snippets/blocks/modelviewer.php:11
#44 include in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:425
#43 Kirby\Filesystem\F:loadIsolated in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:364
#42 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:372
#41 Kirby\Filesystem\F:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Toolkit/Tpl.php:34
#40 Kirby\Toolkit\Tpl:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Template/Snippet.php:170
#39 Kirby\Template\Snippet:factory in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/components.php:284
#38 Kirby\Cms\Core:{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/App.php:1628
#37 Kirby\Cms\App:snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/helpers.php:597
#36 snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/site/snippets/content/content_layout.php:104
#35 include in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:425
#34 Kirby\Filesystem\F:loadIsolated in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:364
#33 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:372
#32 Kirby\Filesystem\F:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Toolkit/Tpl.php:34
#31 Kirby\Toolkit\Tpl:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Template/Snippet.php:170
#30 Kirby\Template\Snippet:factory in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/components.php:284
#29 Kirby\Cms\Core:{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/App.php:1628
#28 Kirby\Cms\App:snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/helpers.php:597
#27 snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/site/snippets/content/content_basic.php:4
#26 include in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:425
#25 Kirby\Filesystem\F:loadIsolated in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:364
#24 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:372
#23 Kirby\Filesystem\F:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Toolkit/Tpl.php:34
#22 Kirby\Toolkit\Tpl:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Template/Snippet.php:170
#21 Kirby\Template\Snippet:factory in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/components.php:284
#20 Kirby\Cms\Core:{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/App.php:1628
#19 Kirby\Cms\App:snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/helpers.php:597
#18 snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/site/snippets/page/page_basic.php:115
#17 include in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:425
#16 Kirby\Filesystem\F:loadIsolated in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:364
#15 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:372
#14 Kirby\Filesystem\F:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Toolkit/Tpl.php:34
#13 Kirby\Toolkit\Tpl:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Template/Snippet.php:170
#12 Kirby\Template\Snippet:factory in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/components.php:284
#11 Kirby\Cms\Core:{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/App.php:1628
#10 Kirby\Cms\App:snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/config/helpers.php:597
#9 snippet in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/site/templates/home.php:1
#8 include in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:425
#7 Kirby\Filesystem\F:loadIsolated in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:364
#6 Kirby\Filesystem\F:Kirby\Filesystem\{closure} in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Filesystem/F.php:372
#5 Kirby\Filesystem\F:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Toolkit/Tpl.php:34
#4 Kirby\Toolkit\Tpl:load in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Template/Template.php:155
#3 Kirby\Template\Template:render in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/Page.php:1071
#2 Kirby\Cms\Page:render in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/App.php:804
#1 Kirby\Cms\App:io in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/kirby/src/Cms/App.php:1243
#0 Kirby\Cms\App:render in /customers/b/4/7/johannesverwoerd.nl/httpd.www/clients/typeinspace/index.php:5
}
/**
* Converts the Field object to an array
*
* @return array
*/
public function toArray(): array
{
return [$this->key => $this->value];
}
/**
* Returns the field value as string
*
* @return string
*/
public function toString(): string
{
return (string)$this->value;