Title: Cannot Import CSV Donations
Last modified: December 14, 2018

---

# Cannot Import CSV Donations

 *  Resolved [RadiantPunch](https://wordpress.org/support/users/radiantpunch/)
 * (@radiantpunch)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/)
 * Hello,
 * My client uses the import feature often to add offline donations. After updating
   to the most recent release of WordPress, she is getting the following error when
   tring to import the CSV file:
 * Sorry, this file type is not permitted for security reasons.
 * Please let me know if you need additional info. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [cdonner](https://wordpress.org/support/users/cdonner/)
 * (@cdonner)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/#post-10995350)
 * Ditto. CSV import of donations no longer works.
    The “Disable Real MIME Check”
   plugin allowed me to work around this, but it needs to be deactivated after each
   use, so not a real solution.
    -  This reply was modified 7 years, 5 months ago by [cdonner](https://wordpress.org/support/users/cdonner/).
      Reason: was wrong about what caused the issue
 *  Thread Starter [RadiantPunch](https://wordpress.org/support/users/radiantpunch/)
 * (@radiantpunch)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/#post-10999349)
 * [@cdonner](https://wordpress.org/support/users/cdonner/) thanks for commenting.
   I’ll use that workaround too while I wait for their response.
 *  Plugin Contributor [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/#post-10999533)
 * Hi folks,
 * Can you do me a favor, and deactivate that “Disable Real MIME Check” plugin, 
   then go to “Media > Add Media” and try to upload your CSV file there? I have 
   a feeling the error you are experiencing is due to your server environment security
   settings and would affect ALL of WordPress, not just Give.
 * See here for details:
    [https://mybrotherdarryl.com/wordpress-sorry-this-file-type-is-not-permitted-for-security-reasons/](https://mybrotherdarryl.com/wordpress-sorry-this-file-type-is-not-permitted-for-security-reasons/)
 * Let me know on that, and if that’s the case I can recommend that plugin to others
   going forward. Thanks!
 *  Thread Starter [RadiantPunch](https://wordpress.org/support/users/radiantpunch/)
 * (@radiantpunch)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/#post-10999557)
 * [@webdevmattcrom](https://wordpress.org/support/users/webdevmattcrom/) Thanks
   for responding. Yup, it’s the media library across the board. Looks like they
   are aware: [https://core.trac.wordpress.org/ticket/45615](https://core.trac.wordpress.org/ticket/45615)
   hopefully it will be fixed in the next release.
 *  Plugin Contributor [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/#post-11013333)
 * It looks like this issue will be addressed in WordPress Core version 5.0.3 currently.
   That will most likely be released in the new year. Until then, I believe either
   the plugin mentioned above, or this snippet is a valid workaround for now:
 *     ```
       add_filter('wp_check_filetype_and_ext', function($values, $file, $filename, $mimes) {
       	if ( extension_loaded( 'fileinfo' ) ) {
       		// with the php-extension, a CSV file is issues type text/plain so we fix that back to 
       		// text/csv by trusting the file extension.
       		$finfo     = finfo_open( FILEINFO_MIME_TYPE );
       		$real_mime = finfo_file( $finfo, $file );
       		finfo_close( $finfo );
       		if ( $real_mime === 'text/plain' && preg_match( '/\.(csv)$/i', $filename ) ) {
       			$values['ext']  = 'csv';
       			$values['type'] = 'text/csv';
       		}
       	} else {
       		// without the php-extension, we probably don't have the issue at all, but just to be sure...
       		if ( preg_match( '/\.(csv)$/i', $filename ) ) {
       			$values['ext']  = 'csv';
       			$values['type'] = 'text/csv';
       		}
       	}
       	return $values;
       }, PHP_INT_MAX, 4);
       ```
   
 * If you need guidance implementing custom PHP functions on your website, we have
   this guide here: [https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/](https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/)
 * Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Cannot Import CSV Donations’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [File Type](https://wordpress.org/support/topic-tag/file-type/)
 * [Import](https://wordpress.org/support/topic-tag/import/)

 * 5 replies
 * 3 participants
 * Last reply from: [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/cannot-import-csv-donations/#post-11013333)
 * Status: resolved