I have a web server running on a BBB and serving an html page with some 
tabular data and control buttons. On demand, I would like to download a 
file of the tabular data to the client. I can create, write, and delete the 
file with the fs module.

In the web page, I have HTML like <a href="Sample.txt" download>Click to 
download.</a>

When I click, I get a download file named "Sample.txt" but the contents of 
the file are the HTML code of the web page.  I think this is because I am 
not handling the download command in the server side JavaScript.

Can someone explain what JavaScript should be in the server to catch the 
'download' command and return the specified file? What should the 
"socket.on(???, downloadFile);" look like? What's the correct way to return 
the file so the client browser correctly saves it?

I can provide the rest of the code if needed, but it seems to be working - 
I just can't find references to handling the file download from that <a> 
element.

Thanks. 

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/ea30a94a-b568-44f3-b1e6-da614dbb84a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to