{"id":6865,"date":"2022-01-28T14:01:33","date_gmt":"2022-01-28T12:01:33","guid":{"rendered":"https:\/\/mummila.net\/kommentit\/?p=6865"},"modified":"2022-01-28T14:01:33","modified_gmt":"2022-01-28T12:01:33","slug":"json-files-attached-to-a-card-with-json-filename-extension-are-empty-when-downloaded","status":"publish","type":"post","link":"https:\/\/mummila.net\/kommentit\/2022\/01\/28\/json-files-attached-to-a-card-with-json-filename-extension-are-empty-when-downloaded\/","title":{"rendered":"JSON files attached to a card (with .json filename extension) are empty when downloaded"},"content":{"rendered":"<h2>Issue<\/h2>\n<p>JSON files can be added to cards as attachments, but they are empty when downloaded from a card.<\/p>\n<h3>Server Setup Information<\/h3>\n<ul>\n<li>Did you test in newest Wekan?: 5.90<\/li>\n<li>Did you configure root-url correctly so Wekan cards open correctly? yes<\/li>\n<li>Operating System: Ubuntu 20.04<\/li>\n<li>Deployment Method: snap<\/li>\n<li>Http frontend if any: Apache<\/li>\n<li>What webbrowser version are you using? Firefox (reproducible in Brave too)<\/li>\n<\/ul>\n<h3>Problem description<\/h3>\n<h4>Reproduction Steps<\/h4>\n<ol>\n<li>Have a JSON file, such as <a href=\"https:\/\/en.wikipedia.org\/w\/index.php?title=JSON&amp;oldid=1066897777#Syntax\">the example from Wikipedia<\/a>. Name it <code>example.json<\/code>.<\/li>\n<li>Open a card in Wekan.<\/li>\n<li>Select + from the Attachments section.<\/li>\n<li>Select &#8221;Computer&#8221; from the popup.<\/li>\n<li>Select <code>example.json<\/code>.<\/li>\n<li>With the JSON file now attached to the card, select to &#8221;Download&#8221; it.<\/li>\n<li>Open the downloaded JSON file.<\/li>\n<\/ol>\n<h4>What I expect to happen<\/h4>\n<p>For the downloaded file contents to match the uploaded file.<\/p>\n<h4>What happens instead<\/h4>\n<p>The file is empty.<\/p>\n<h4>Logs<\/h4>\n<p>Nothing in either the browser console nor <a href=\"https:\/\/github.com\/wekan\/wekan\/files\/7958396\/wekan.log\">snap logs<\/a> when the issue is triggered.<\/p>\n<h4>Other info<\/h4>\n<ul>\n<li>Deleting the attachment seems to work.<\/li>\n<li>The issue can be worked around by renaming the JSON file prior to uploading to have a .txt extension instead of (or in addition to) .json.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>JSON files can be added to cards as attachments, but they are empty when downloaded from a card.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8860],"tags":[13999,22890,546,14051,2679,14042,2958],"class_list":["post-6865","post","type-post","status-publish","format-standard","hentry","category-vianhallintajarjestelmat","tag-apache","tag-brave","tag-firefox","tag-snap","tag-ubuntu","tag-wekan","tag-wikipedia","sijainti-github"],"_links":{"self":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/6865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/comments?post=6865"}],"version-history":[{"count":1,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/6865\/revisions"}],"predecessor-version":[{"id":6866,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/6865\/revisions\/6866"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/media?parent=6865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/categories?post=6865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/tags?post=6865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}