Closed lokeshKumar90 closed 4 years ago
Please format your code snippets
Hi Rikschennink,
I have found the solution. Thanks.
@lokeshKumar90 What was the resolution? I am writing a spfx webpage using react and have an issue where it doesn't recognise the type for msg files I am also unable to use the property fileValidateTypeDetectType even though I have installed the plugin. Did you have to include any particular code to get it to work?
@thepower50
Sometimes a browser doesn’t succeed in detecting the correct mime type for a file. In that situation the file type property is empty and FilePond can’t determine the correct type either (it relies on the browser engine).
I faced the same problem and looked at https://pqina.nl/filepond/docs/patterns/plugins/file-validate-type/#custom-type-detection for a solution. I think you can fix the problem by using :allow-file-type-validation = "false"
.
Sample usage:
Hi,
I am using filepond plugin for uploading the files and was not able to upload the outlook item i.e. .msg file. then i found a solution and now i am using fileValidateTypeDetectType to resolve the type of .msg file as it was coming as "". it is working for msg file alone and if i add other mime types to the accepted filetypes it doesnt work all of them work excepts outlook item.
Below is the code for that. import React, { Component } from "react"; import ReactDOM from "react-dom";
// import "./styles.css";
// Import React FilePond import { FilePond, registerPlugin } from "react-filepond";
// Import FilePond styles import "filepond/dist/filepond.min.css";
// Import the Image EXIF Orientation and Image Preview plugins // Note: These need to be installed separately //
npm i filepond-plugin-image-preview filepond-plugin-image-exif-orientation --save
import FilePondPluginImageExifOrientation from "filepond-plugin-image-exif-orientation"; // import FilePondPluginImageCrop from 'filepond-plugin-image-crop'; import FilePondPluginImageResize from "filepond-plugin-image-resize"; import FilePondPluginImageTransform from "filepond-plugin-image-transform"; import FilePondPluginImagePreview from "filepond-plugin-image-preview"; import "filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css"; import FilePondPluginFileValidateType from "filepond-plugin-file-validate-type"; // Register the plugins registerPlugin( FilePondPluginImageExifOrientation, FilePondPluginImageResize, FilePondPluginImageTransform, FilePondPluginImagePreview, FilePondPluginFileValidateType );// Component class App extends Component { constructor(props) { super(props);
}
handleInit() { console.log("FilePond instance has initialised", this.pond); }
render() { const allowedType = [ "application/vnd.ms-outlook", "image/png", "application/pdf" ]; return (
} }
const rootElement = document.getElementById("root"); ReactDOM.render( , rootElement);
what can i do to resolve this issue. i want .msg file to be uploaded with other file types as well.