Fix record import via some CSV files
Some CSV files failed to detect as text/csv so the import failed. ref: https://github.com/gabriel-vasile/mimetype/issues/138
This commit is contained in:
@@ -39,6 +39,10 @@ func (y *decoder) CanDecodeFile(f io.Reader) bool {
|
||||
return y.CanDecodeExt(ext)
|
||||
}
|
||||
|
||||
func (y *decoder) CanDecodeMime(m string) bool {
|
||||
return m == "text/csv"
|
||||
}
|
||||
|
||||
func (y *decoder) CanDecodeExt(ext string) bool {
|
||||
pt := strings.Split(ext, ".")
|
||||
return strings.TrimSpace(pt[len(pt)-1]) == "csv"
|
||||
|
||||
Reference in New Issue
Block a user