Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue downloading csv #114

Closed
emrysr opened this issue Jan 10, 2020 · 1 comment
Closed

issue downloading csv #114

emrysr opened this issue Jan 10, 2020 · 1 comment
Labels

Comments

@emrysr
Copy link
Contributor

emrysr commented Jan 10, 2020

when attempting to download a CSV of a graph's data I get this error in the downloaded file:

Warning: Invalid argument supplied for foreach() in /var/www/emoncms/Modules/graph/graph_controller.php on line 97

Warning: file_get_contents(http://localhost/emonmcs//feed/aget.json?id=12): failed to open stream: HTTP request failed! HTTP/1.0 406 Not Acceptable
in /var/www/emoncms/Modules/graph/graph_controller.php on line 130

"Date-time string",": ()"

I was able to overcome the error by marking the feed as public before attempting to re-download.

⚠ WARNING: SELECT ALL...

If you Select All-> Edit -> Make Feed Public then all the feeds come under a single node

Loading the feed/data.json api endpoint used in the graph controller works when logged in:
https://github.com/emoncms/graph/blob/master/graph_controller.php#L89

Seems to be an issue with php downloading the data from /feed before returning it as CSV - without being logged in ?

@TrystanLea
Copy link
Member

I think the current implementation of this feature is over complicating things.. the content that the user wishes to download has already been generated in the graph view, we just need to provide this existing content as a download.

There's a neat bit of code in this stack overflow here to do this:
https://stackoverflow.com/questions/3665115/how-to-create-a-file-in-memory-for-user-to-download-but-not-through-server

I've implemented and tested it here, seems to work well
https://github.com/emoncms/graph/compare/js_download_csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants