Title: Uploading data files
Last modified: May 14, 2024

---

# Uploading data files

 *  [Graham](https://wordpress.org/support/users/aerin/)
 * (@aerin)
 * [2 years ago](https://wordpress.org/support/topic/uploading-data-files/)
 * My plugin imports a dataset from a CSV. The data is then sanitised and a new 
   options table row created.
 * PCP returns this error:
 * “The use of function move_uploaded_file() is forbidden”
 * I’m really not sure how to fix this as it’s the standard PHP function for uploading
   temporary files. There doesn’t appear to be any alternative method of importing
   a file.

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

 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [2 years ago](https://wordpress.org/support/topic/uploading-data-files/#post-17756880)
 * Hi [@aerin](https://wordpress.org/support/users/aerin/),
 * Not an expert in this area, but have you tried [wp_upload_bits](https://developer.wordpress.org/reference/functions/wp_upload_bits/)
   instead?
 * It may also be possible via [_wp_handle_upload ](https://developer.wordpress.org/reference/functions/wp_handle_upload/)
   and [wp_upload_dir()](https://developer.wordpress.org/reference/functions/wp_upload_dir/)
   as per [this stackexchange topic](https://wordpress.stackexchange.com/questions/346316/move-uploaded-file-not-working-on-wordpress-front-end).
 *  Thread Starter [Graham](https://wordpress.org/support/users/aerin/)
 * (@aerin)
 * [2 years ago](https://wordpress.org/support/topic/uploading-data-files/#post-17757109)
 * Thanks James. I have been looking wp_upload_bits and it may well be the solution.
 * But I’d still like to know why move_uploaded_file() is forbidden. It works and
   has been working since forever on other plugins I’ve submitted to the WP repository.
 *  [Pascal Birchler](https://wordpress.org/support/users/swissspidy/)
 * (@swissspidy)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/uploading-data-files/#post-17865298)
 * Security-wise,`move_uploaded_file` doesn’t really do much validation and people
   usually use it without any additional validation either. Then there are also 
   reliability issues on certain filesystem setups with different permissions etc.
   For these reasons it’s always advisable to use the functions provided by WordPress
   for such things. Then you are on the safe side.
 * For specific questions about plugin submission, please ask in the #pluginreview
   Slack channel.
 *  Thread Starter [Graham](https://wordpress.org/support/users/aerin/)
 * (@aerin)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/uploading-data-files/#post-17865400)
 * Thanks [@swissspidy](https://wordpress.org/support/users/swissspidy/). The problem
   I have is I can’t find a suitable wordpress function.
 * I do a lot of validation on the uploaded data so I know it’s safe. I’d just like
   to clear the notice on the PCP report.

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

The topic ‘Uploading data files’ is closed to new replies.

 * ![](https://ps.w.org/plugin-check/assets/icon.svg?rev=3166100)
 * [Plugin Check (PCP)](https://wordpress.org/plugins/plugin-check/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/plugin-check/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/plugin-check/)
 * [Active Topics](https://wordpress.org/support/plugin/plugin-check/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/plugin-check/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/plugin-check/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Graham](https://wordpress.org/support/users/aerin/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/uploading-data-files/#post-17865400)
 * Status: not resolved