Title: Export &amp; Import Correct Method?
Last modified: August 30, 2016

---

# Export & Import Correct Method?

 *  Resolved [yst14](https://wordpress.org/support/users/yst14/)
 * (@yst14)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/export-import-correct-method/)
 * Hi.
 * I am using the latest version of APF and I am trying to get import and export
   to work.
 * I have used the field types ‘export’ & ‘import’. The export seems to export a
   JSON file perfectly fine. However the import gives me an error:
    `The uploaded
   file type is not supported: application/json`
 * My plugin source is hosted here:
    [https://bitbucket.org/ben_noou/noouswatches/src/b1104e39ff7b0a1f30cd06f8ca208dd42536b82b/NoouSwatches.php?at=master&fileviewer=file-view-default](https://bitbucket.org/ben_noou/noouswatches/src/b1104e39ff7b0a1f30cd06f8ca208dd42536b82b/NoouSwatches.php?at=master&fileviewer=file-view-default)
 * I have seen in the V3 docs there seems to be a slightly different import method
   however I cannot seem to get my head around it. I was wondering if you could 
   provide me with a solution to this?
 * My Current import code:
 *  ` array( // import button
    ‘field_id’ => ‘import_button’, ‘type’ => ‘import’,)`
 * Thank you very much!
 * [https://wordpress.org/plugins/admin-page-framework/](https://wordpress.org/plugins/admin-page-framework/)

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

 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/export-import-correct-method/#post-6808950)
 * Can you try adding this method to your admin class?
 *     ```
       /**
        * @callback        filter      import_mime_types_{page slug}
        */
       public function import_mime_types_noou_swatches_options( $aMineTypes ) {
           $aMineTypes[] = 'application/json';
           return $aMineTypes;
       }
       ```
   
 *  Thread Starter [yst14](https://wordpress.org/support/users/yst14/)
 * (@yst14)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/export-import-correct-method/#post-6808975)
 * Hi Miunosoft.
 * That worked!! Thank you 🙂
 * Is there any way that I can ADD to the list of colours rather than overwrite 
   the current list?
 * Thank you
 *  Plugin Author [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * (@miunosoft)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/export-import-correct-method/#post-6808976)
 * Glad to help!
 * As for a different issue, create a new topic. Make sure to provide details so
   that I can understand as I don’t seem to understand the question in your last
   reply. Thanks!

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

The topic ‘Export & Import Correct Method?’ is closed to new replies.

 * ![](https://ps.w.org/admin-page-framework/assets/icon-256x256.png?rev=998199)
 * [Admin Page Framework](https://wordpress.org/plugins/admin-page-framework/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/admin-page-framework/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/admin-page-framework/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-page-framework/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-page-framework/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-page-framework/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [miunosoft](https://wordpress.org/support/users/miunosoft/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/export-import-correct-method/#post-6808976)
 * Status: resolved