• Hi, I tried other plugins for importing csv, but this simple plugin is great. But there are several problems on my webhosting:

    1) Open_basedir restriction with /tmp directory and function tempnam
    $t_fname = tempnam(md5(''), __CLASS__ . '_');
    I have to change it to $t_fname = @tempnam(md5(''), __CLASS__ . '_');and now it works for me.

    2) Plugin uses file_get_contents which is blocked by my webhoster. Is it possible to change it to curl or any other way?
    I uncomment this line $res = fopen($this->_filename, 'r'); and commented this line: // $res = $this->_patch(); and it works now, but I am not sure if there is any hidden problem…

    3) Feature request: Is it possible to create Post Title from for example three columns? For example author in column 1 and title in column 2 and I want to create post title “author: title”. It would be great. I know that I can do it directly in the file, but I need to do it everyday which is really boring…

    Thank you very much for this great little plugin.

Viewing 11 replies - 16 through 26 (of 26 total)
  • Never mind, I’m using Import CSV (https://importcsv.com) now which doesn’t choke on my CSV.

    reface: Well, whatever works for you ??

    Guys, if you expect me to help you with your CSV files, please post them somewhere. I’m not psychic and I can’t tell you what’s wrong with your file unless I can take a look at it with my own eyes.

    Hello Dvkob,

    Thanks for the great plugin. I’m getting the same “Invalid CSV file: header length and/or row lengths do not match.” error on import.

    Would you be so kind as to take a look at my csv at:

    online-training-portal.com/sample4.zip

    I really appreciate it…

    Mark

    markbm: Finally got a chance to look at your file. The problem starts at row 17: “How to use Furlnet” and continues on rows below – you don’t have two trailing commas that represent empty values for custom_field_1 and custom_field_2. To see what I mean, just look at rows 1 – 16. They all have to be formatted the same way.

    markbm: You can also upgrade to the latest version of the plugin that will handle your file without throwing an error.

    I know 3 was an old question, but to combine the titles the best thing to do is use the concatenate function in Excel to do this yourself.

    So far that’s worked out pretty well for me (and is how I makeup most of the post body). When you save as a CSV the formula automatically gets kicked out. If you haven’t found another way, hope that helps.

    YMO: Great tip! I had a very strong suspicion that concatenating fields is not the job for the plugin. Do you think you could write a short step-by-step instruction on how to combine two fields to form csv_post_title? I would gladly put it in the FAQ.

    Some months ago you talked about a problem of tmp dir. I have the same problem and I have a question about it. For the moment, I can do the plugin work making the following change on DataSource.php file:

    $t_fname = tempnam(md5(''), __CLASS__ . '_');

    to

    $t_fname = tempnam('/var/www/web5/domain.com', __CLASS__ . '_');

    But you said that it’s really preferable to add /tmp to open_basedir because of the future plugin updates. How can I do that? I can’t edit server seetings. Does my webhosting company make this change easily for me?

    Thanks!

    Sorry, it’s good in English,
    But cannot import Chinese Word.
    Can anyone help me to import Chinese Word?

    I came across this thread when I googled the issue of 0 posts being posted so I just thought I’d add a suggested solution here. As per earlier posts my problem was my hosting offering a system tmp dir that wasn’t actually writable. So the patch that writes out a new file wasn’t working. I figured the one dir we definietly know we have access to at this point is the php upload dir (this is where the csv file is uploaded to and must be writable is we have got this far into the plugin). So we use that instead. To do this, in the file DataSource.php, function _patch(), replace the line

    $t_fname = tempnam(md5(''), __CLASS__ . '_');

    wih

    $t_fname = tempnam(ini_get('upload_tmp_dir'), __CLASS__ . '_');

    This works for me – your mileage may vary. There may well be reasons why we don’t want to do this but it seems reasonable to me at this stage.

    Cheers,
    Colm

    IrishGuyDublin: Good thinking. I have a choice between updating the csv parser to the latest version, which doesn’t create temporary files and your solution. I’ll see what works best.

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘[Plugin: CSV Importer] Some problems with this great plugin’ is closed to new replies.