• Resolved sirhaver

    (@sirhaver)


    Hello support,

    The plugin seems great, but when I upload a .csv file which I save with Microsoft Excel I get an error message: “This is not a valid .csv file extension.”

    Why do you think this is happening? It seems that the .cvs file is ok and I followed a detailed youtube tutorial on how to save my table as .csv

    Thanks in advance,
    Omer

Viewing 6 replies - 1 through 6 (of 6 total)
  • Just click button ‘link on file’ after you choose the file

    Thread Starter sirhaver

    (@sirhaver)

    There is no such button ‘link on file’, do you mean the button ‘insert into post’ ?
    After I choose the file and press this buton, I get the error “This is not a valid .csv file extension” but the csv file is ok and saved from Excel.

    What do you think could cause this?

    Thanks in advance,
    Omer

    No, this button is above the ‘insert into post’ button. Above the ‘insert into post’ button you can see 3 buttons, so ‘link on file’ is second of them (I have russian language for this plugin, so I am not sure that her name is exactly “link on file”).
    If i do not click “link on file” before insert into post i am getting the same error
    Hope it helps

    I too didn’t figure this out at first. Having to manually get the link to populate the File Upload box is very unintuitive. This is a design flaw that should be fixed.

    Also, fopen is not converting the URL in the upload to a valid file path on some server setups, so you get erroneous messages like this:

    “No valid .csv file was found at the specified url.”

    I corrected this by altering your code in main.php (line 213) :

    replace this:
    if(( $fh = @fopen($_POST['csv_file'], 'r')) !== false) {

    with this:

    
    $myCSV = $_POST['csv_file'];
    $path = parse_url($myCSV, PHP_URL_PATH);
    $myCSV = $_SERVER['DOCUMENT_ROOT'] . $path;
    
    if(( $fh = @fopen($myCSV, 'r')) !== false) {
    • This reply was modified 6 years, 5 months ago by e dev.
    • This reply was modified 6 years, 5 months ago by e dev.
    • This reply was modified 6 years, 5 months ago by e dev.
    Plugin Author mra13

    (@mra13)

    Thank you. I have updated the plugin with your code.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘“This is not a valid .csv file extension”’ is closed to new replies.