WordPress.org

Ready to get started?Download WordPress

Forums

Upload a .csv file to media library (6 posts)

  1. Marteens
    Member
    Posted 2 years ago #

    Hi!

    I have recently started using this plugin for making tables called Websimon Tables, and I like it very much. Now, there is an "import table via .csv-file" feature (in beta), and in that way it should be possible (I think) to copy an Excel spreadsheet into a nice-looking table on your site. But, I have a problem. The plugin tells me to do this:

    First upload your .csv file via your wordpress media uploader.
    Then paste the file url into "File url:" input field below.
    Choose an unique table name.
    If first row is headlines, check the option for that
    Click import.

    So, I saved my spreadsheet as an .csv comma separated file, but when I try to upload this file in the media library in wordpress I get a error message. Is .csv -files not supported in the media library? How can I make this possible?

    Thank you!

  2. Marteens
    Member
    Posted 2 years ago #

    Anyone? I am still looking for a way to upload a .csv file to my media library.

    From http://codex.wordpress.org/Uploading_Files, I understand that .csv files not are supported..

    Is there a way to allow .csv files in the media library?

  3. Patrikgrinsvall
    Member
    Posted 1 year ago #

    Do like this:

    add_filter('upload_mimes', 'my_upload_mimes');
    
    function my_upload_mimes ( $existing_mimes=array() ) {
        $existing_mimes['csv'] = 'text/csv';
        return $existing_mimes;
    }
  4. Marteens
    Member
    Posted 1 year ago #

    Thank you!

    I'm sorry about the noob question, but where do I put this?

  5. Patrikgrinsvall
    Member
    Posted 1 year ago #

    In your plugin or in your functions.php

  6. Marteens
    Member
    Posted 1 year ago #

    Thank you, with this I am able to upload .csv-files to the media library, but for some reason (maybe it's the plugin) I am not able to import it into the plugin like I wish. The plugin gives me an empty table 1*18 where I had saved a 10*18 table with text. Not sure why.

    Anyway now I am at least one step closer, so thanks again :)

Topic Closed

This topic has been closed to new replies.

About this Topic