SimpleMap Store Locator
Fix Suggestion for Import Directory (1 post)

  1. zaus
    Posted 3 years ago #

    Currently uploading a CSV file for import saves the file (temporarily) to the /plugins/ directory, which requires that you change folder permissions to allow it to do so.

    This seems a little weird -- why not use the actual WordPress upload directory? Then you don't need to worry about permissions, as this is the appropriate folder for uploads.

    I suggest changing anywhere in the file import-export.php it uses $file_location = ... to the following:

    $file_location = $this->get_import_path($blog_id . '.csv');


    function get_import_path($file) {
    	$upload_dir = wp_upload_dir();
    	// fallback to original path...?
    	if( isset($upload_dir['error']) && !empty($upload_dir['error']) ) return WP_PLUGIN_DIR . '/sm-temp-csv-' . $file;
    	return $upload_dir['path'] . '\\' . $file;


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SimpleMap Store Locator
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic