-
Notifications
You must be signed in to change notification settings - Fork 17
how to write file and auto download? #3
Comments
What is the scenario you are looking for? You have data in the server and you want the user to press a button in the client and have it download the file? |
I come from Laravel PHP framework, and i used PHPExcel package to generate reports with excel file template. So I want to generate report with excel template file and pass the data in to the template and download it (when i press a button on the form). |
I also have the same need. This django package has this exact functionality and works great : https://pypi.python.org/pypi/django-excel-response |
Finally got to it and wrote an example. Check it out here: http://meteorpad.com/pad/2hjNqmwHjDvkxvLC5/Leaderboard. |
Very thanks, I will try. |
I tried include the relevent code in my meteor app. I get a console.log message of More details: More details: Perhaps the a element has to be attached to the dom and made visible for click to work? |
As @dpatte pointed out, it seems that the example does not work in Firefox 37.0.1. Adding: I wonder however if it would be possible to implement js-xlsx's XLSX.write() -method in this package so that the written document could be just returned from a meteor method and then served with FileSaver.js in the front-end, like in the latter example in js-xlsx readme. This would result in significantly simpler code and remove the requirement for any temporary file collection. |
@Waiski I'm currently thinking about implementing a simpler solution. Using FileSaver.js is a possibility but the problem is that browser support doesn't seem optimal in the older browsers. |
I now have modified my code and have perhaps have a hint of the issue Template.pipeline.events( Using the above, the eexcel file is generated and does download. everything looks fine until i OK the alert at which point all my subscriptions are gone. I have to do a page refresh to get the page to redraw correctly, |
@dpatte If everything works fine without the link.target then maybe it is not needed and can be just removed? |
you missed my point, I believe. |
I have raised my download issue with vsivsi of meteor-file-collection. I believe now the download issue is not a problem of meteor-excel but some issue with vsivsi 's file collection package. |
I have more details on this.... On Chrome, to automaticaly download I am using the code from the meteorpad example: In FF this now downloads, but causes another problem...the socket is lost, and the suscriptions are lost. Refreshing the page restores them. |
The meteorpad is currently not loading. |
Excuse me, could you example for me.
how to write file and auto download?
The text was updated successfully, but these errors were encountered: