Topic: hiding reply from csv upload

When we send the csv up to QuickFuse we get a message back:
{"rows":1,"replace":false,"tablekey":"[acct.net:tablename]","result":true}

How can we hide this message so it doesn't show on the page?

Re: hiding reply from csv upload

Hi,

We've uploaded various CSVs to QuickFuse and have never received this message.  Which browser are you using when this occurs?  Are there any other specifics you could give us to help replicate this issue?

Thanks,
The QuickFuse Team

Re: hiding reply from csv upload

It happens with Firefox in Linux and also with IE in Win7.  This is the code I'm using to upload the csv file:

$postfields = array(
    'tablekey' => $MsgAcq_Tablekey,
    'mode'=> 'merge',
    'csv' => '@'.$MsgAcq_fileName
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $PVuploadurl);
curl_setopt($ch, CURLOPT_USERPWD, $PVuser);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);

$out = curl_exec($ch);
echo $out;
curl_close($ch);

I've tried removing the '$out =' from the '$out = curl_exec($ch);' line and the'echo $out', but that doesn't seem to make any difference.

Re: hiding reply from csv upload

Ah, you are using the API!  This is a PHP code example, so fortunately we have some experience with that.

By default PHP's curl_exec echos its fetched data directly instead of returning it; to disable this and have it return the contents as a string, use the CURLOPT_RETURNTRANSFER option.  So add this to the end of your curl_setopt calls:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

and remove

echo $out;

and then you should not see the returned JSON.  $out will contain the JSON though, if you want to do further processing on it.

Re: hiding reply from csv upload

Thank you. That seems to have done it. I think I tried each of the two steps separately but not both together or something like that.