WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. zaus
    Member
    Posted 1 year 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');

    using

    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;
    }

    http://wordpress.org/extend/plugins/simplemap/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic