[Bug 8963] New: Can not upload csv file for Quote of the day
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8963 Priority: P5 - low Change sponsored?: --- Bug ID: 8963 CC: gmcharlt@gmail.com Assignee: koha-bugs@lists.koha-community.org Summary: Can not upload csv file for Quote of the day Severity: normal Classification: Unclassified OS: All Reporter: veron@veron.ch Hardware: All Status: NEW Version: master Component: Staff Client Product: Koha Steps to reproduce: Go to Home › Tools › Quote editor › Quote uploader Choose a .csv file to upload for the "Quotes of the Day" You get an alert: "Uploads limited to csv. Incorrect filetype: unknown" and the file is cleared. It seems that in koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt, JavaScript function fnHandleFileSelect(evt), the value of evt.target.files[0].type is empty or undefined. Other properties of evt.target.files[0] like file name or size are populated as expected, and with .txt files the type resolves to txt/plain. Tested with Firefox 16.01 and Chrome 22.0.1229.94 m on Windows 7 Workaround: Do not use uploader, insert quotes manually. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8963 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8963 --- Comment #1 from Marc Véron <veron@veron.ch> --- Update: I did a test by changing the code after "sanity check" in koha-tmpl/intranet-tmpl/prog/en/modules/toolsto accept .txt files as well. While this would provide a workaround, I got an other glitch: If the file is not UTF-8 encoded, you get garbled characters with umlauts etc. This is due to following line (no encoding paramter given): reader.readAsText(evt.target.files[0]); FileReader.readAsText(File, encoding) defaults to encoding = "UTF-8". It seems to be difficult to determine the file's encoding for use param, see: http://stackoverflow.com/questions/10338235/javascript-reading-local-text-fi... --snip---- You'd need to analyze the raw binaries of the text file to have a best guess at what the encoding is. There isn't any libraries for this in javascript AFAIK but you could port one from other languages. Since that isn't very robust, you should also provide a manual override like Characters not showing correctly? Change encoding: --snip---- -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8963 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Can not upload csv file for |Can not upload csv file for |Quote of the day |Quote of the day and | |encoding problems with | |non-UTF-8 files -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8963 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org