This topic is locked

export import problems

7/23/2008 7:51:16 AM
PHPRunner General questions
hfg author

I have run into two problems with exporting and importing

  1. When exporting data that has an & in it to csv it gets converted to &
    For example AT&112 gets turned into AT&112 in the csv. It remains this way when I import it into a different database.
  2. Since I ran into the problem above I tried using Excel (xls) instead. The export worked, leaving & as just &, I ran into a different problem which I know others have encountered but I was unable to find any solutions. When I tried to import I got the following error:
    The filename C:\WINDOWS\TEMP\php555.tmp is not readable
    php555.tmp changes name each time. I went looking to see if the file existed in the temp folder and it did not.
    Any help is appreciated

J
Jane 7/23/2008

Hi,
see my answers below:

  1. to export & symbols to CSV file edit generated ..._export.php file.

    Locate ExportToCSV function, find this line:
    $outstr.='"'.htmlspecialchars(GetData($row,"FieldName",$format)).'"';



and replace it with this one:

$outstr.='"'.GetData($row,"FieldName",$format).'"';


2. make sure that file uploading is set up properly in your PHP.

I.e.

C:\WINDOWS\TEMP folder exists and IUSR_... user has read/write permissions on it.

Do you have file uploading working in your other PHP projects ?

hfg author 7/23/2008

Jane,
Thanks for the replies

  1. Looks to be working, thanks for the fix
  2. The _IUSR user does not have any rights to the temp folder at this point on the server. However the CSV import works fine. I have not tried using the excel import before. I do use CSV for a number of projects.
    I gave the _IUSR user permission read/write premissions and tried again, with the same result.