Error on uploading mp3 - No route found for path: "upload" and request method: "GET"

Hi! Iā€™m trying to upload an mp3 via a file field in panel, but I keep getting the error message:

No route found for path: ā€œuploadā€ and request method: ā€œGETā€

I donā€™t have this problem when uploading on local server. Any ideas what the problem might be?

Hereā€™s the yaml for the field in question:

    Track:
    type: files
    multiple: false
    uploads: true

Hm, sounds as if POST requests are disabled, because the upload path is only available for POST requests, not for GET requests.

how can I test / fix this?

Itā€™s weird because it doesnā€™t happen when I upload a cover image to the same page, or photos to a different page - which I assume would need to use the POST requests?

Yes, and it would be very strange if POST requests were disabled, anyway.

Try removing the uploads: true line, it doesnā€™t make sense, because uploads are enabled by default and I think if not false, this option expects a file template name.

I remove the uploads true line but getting the same problem. I just tested it with a couple of different .mp3 files and they upload fine, so maybe itā€™s a problem with this particular mp3 file! Weird! It plays fine, but maybe thereā€™s something gone bad with the file? Iā€™m gonna try re-exporting it later and Iā€™ll let you know what happens.

That might be the caseā€¦

The problem was that the filename had an apostrophe in it - it was called donā€™t-flush-my-head.mp3. I renamed it to dont-flush-my-head.mp3 and it uploaded fine.

I thought kirby had an auto file renaming system though? Is something broken that I need to tend to?

Thank you for your help, by the way! :relaxed:

Hm, I tried uploading a file with an apostrophe without issues. What is your Kirby version? Might be something server side after allā€¦

Iā€™m on 3.3.0. I recently dabbled with the .htaccess file to forward the http:// and no-www to https://www so Iā€™m not sure if thatā€™s messed something up? I tried reverting to the original .htaccess file and the problem persisted so Iā€™m not entirely sure thatā€™s it.

We are currently at 3.3.6, so updating sounds like a good ideaā€¦

oh cool, thanks for the heads up. Iā€™ll do so!

Hm, I updated but the same problem remains when I upload the file with the apostrophe.

:thinking:

Hello!

I had the same kinda error as youā€™re mentioning.
I had set my .htaccess file to force trailing slash.

With this setting on I didnā€™t have any problems on first sight but when I tried to upload a simple pdf file I had this exact error.

Not sure if you do have this setting but as youā€™re mentioning that you ā€œdabbled with the .htaccess fileā€ I assume that could be your problem too.

Please note that browser can be very annoying when it comes to .htaccess/301 redirects and cache the hell out of that.

I would recommend you to try this in another browser / private window.

Hope this helps!

Just for reference if anyone gets same error if you donā€™t have file upload with same key somewhere in blueprint. For example this GitHub - diesdasdigital/kirby-meta-knight: šŸ” Meta Knight ā€“ SEO & Social Media Sharing Plugin for Kirby. seo plugin generates many meta_KEY fields. So you might have conflict there.