how to disable query string added to csv file name

Answered
Bhagvan Chougule asked on August 25, 2016

Hi,
        While loading report I would like to read local csv file using file system. I changed file name in report xml to point to csv file on local machine e.g. file:///home/bhagvan/treeni/gitroot/data-integration/public/csv/analytic.csv
Flexmonster script adds query string at the end to avoid caching but that leads to a problem that CSV not found.
Unable to open file file:///home/bhagvan/treeni/gitroot/data-integration/public/csv/analytic1.csv?408919003.
It seems that this file doesn't exist or 'Access-Control-Allow-Origin' header is absent in the resource requested.
 
Is there a way to avoid adding query string parameter?
I get the same error even when I put url for csv file e.g. http://local.resustain.io:3000/csv/analytic1.csv
 
Thanks,
Bhagvan

3 answers

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster August 25, 2016

Hi Bhagvan,
Thank you for your question. Unfortunately, we don't support this type of path "file:///...". We can suggest you using the local server(Node.js, Apache...) for loading your data files. The idea is to have the pass to your file smth like that: http://localhost:51495/.../data.csv Let us know if it works for you.
Best regards,
Dmytro.

Public
Bhagvan Chougule August 25, 2016

Hi Dmytro,
           I tried this as well but no luck. I hosted my xml and csv on webserver but flexmonster component still giving same error.
Infact I tried this on demo on your website. Opened xml using open => remote report option. Entered xml url and getting this error,
Unable to open file http://local.resustain.io:3000/dataview/55ba23c574726555a300001c-55c9c9c474726548f90000a6-1458737810000.xml?408926414.

It seems that this file doesn't exist or 'Access-Control-Allow-Origin' header is absent in the resource requested.
Whereas I can browse the xml as well as csv file through browser. Could you please guide what could be the problem?
 
Thanks,
Bhagvan
 

Public
Iryna Kulchytska Iryna Kulchytska Flexmonster August 26, 2016

Hi Bhagvan,
 
Please note that if Flexmonster component is located in a different domain than http://local.resustain.io:3000, you will need to enable CORS to load the report XML files and CSV data files. The error message means that the browser requires more privileges to load the file. By default, cross-domain data loading is forbidden. Please look at this website https://enable-cors.org/ that will help you to resolve the issue.
 
 
Kind regards,
Iryna

Please login or Register to Submit Answer