FMSA11 + PHP + TXT/CSV Import - import script step failure
I have reached a wall with my PHP/Filemaker solution. Here's the breakdown -
A client can upload a txt/csv file which ultimately will be imported into filemaker pretty much straight away for verification purposes. The PHP page invokes the FMSA script via the newPerformScript command using a script parameter to parse the filename to FMSA. Here's the PHP code that invokes the script :
$filename = $_FILES["file"]["name"];
echo "<br/>Filemaker script has been invoked using script parameter ".$filename." - check to see if the meter reads were imported...</br>";
// Run the script on the server to import the uploaded file of meter reads...
The above PHP code runs the following script (PHPmeter_import_script) :
Set Error Capture [On]
Go to Layout ["PHPmeter_import"](MeterRead_import)
Enter Browse Mode 
Set Variable [$meterfilename;Value:Get(ScriptParameter)]
Set Variable [$meterfilepath;Value:"filewin:/C:/Program Files/FileMaker/FileMaker Server/Data/Documents/" & $meterfilename]
Import Records[No Dialog;"$meterfilepath";Add;Windows ANSI]
Set Field [MeterRead_import::DealerCode;"Import attempt : script parameter was " & $meterfilepath]
If I execute this PHP , the FMSA script runs up until the point of the Import Records step , then stops without error , and the remaining 2 script steps are not executed. If I disable the Import Records step , the last 2 lines of the script ARE executed and I get the following text in a new record :
"Import attempt : script parameter was filewin:/C:/Program Files/FileMaker/FileMaker Server/Data/Documents/Meter3.csv"
So I know the script parameter is being forwarded from PHP to FMSA , (Meter3.csv was the file I uploaded via PHP) and I know that PHP CAN invoke the script on the server.
If I setup a schedule in the admin console to run the script with "Meter3.csv" as the script parameter ,and use the "Run Now" option in the admin console, it successfully imports the file as expected. I am getting a little frustrated and confused as I cannot find any documentation or forum posts regarding this issue.
Here's some versions of what I am using:
Filemaker Server 11 Advanced (220.127.116.11) on Windows 2008 Server Standard (32bit) SP2
Filemaker API for PHP
PHP version 5.2.11
Thanks in advance...
Regards , Lee.