Need a special offer?Find out if your project fits.
+

How to get exportTo data on server side

Answered
Felix Tan asked on May 10, 2021

Hi,
 
May i know how can we get the filedata that passed to remote server? 
Im using exportTo with destinationType server.
What i received in $_POST on server side is just an empty array.
What is the right way to do to handling the data and save the file? Thank you.

5 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster May 11, 2021

Hi Felix,
 
Thank you for posting your question.
 
We have a sample PHP script displaying how to handle Flexmonster export on the server-side - see it attached to this response. Feel free to download it and test it out.
 
Please let us know if this helps.
 
Best regards,
Mykhailo

Attachments:
index.zip

Public
Felix Tan May 12, 2021

Hi,
 
Thank you for your answer.
 
I have a additional question on this. Is it possible to add an additional POST parameter which send together with filedata to server? 
 
If possible, an example is very appreciated. Thank you

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster May 12, 2021

Hi Felix,
 
Thank you for your swift response.
 
You can use the requestHeaders parameter of the exportTo() API call to pass custom headers during export:
 

flexmonster.exportTo('csv', {
destinationType: 'server',
url: 'serverUrl',
requestHeaders: {
'myHeader': "myValue"
}
});

 
Hope you find this helpful!
 
Regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster May 20, 2021

Felix,
 
How are you?
 
Just checking in whether you've found our response helpful. Is there still anything we can help you with?
 
We'd be happy to hear your feedback.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster May 27, 2021

Hi Felix,
 
Hope you're doing well!
 
Were you able to achieve the desired behavior? 
 
Please let us know your thoughts.
 
Mykhailo

Please login or Register to Submit Answer