I have designed a download button in frontend where seller can download invoice but i want to restrict him to download the file only once.How can I that?
This seems more like a general architecture question, but here is how I would handle this: I'd create a database table containing the customer ID, invoice ID, and download count. When the customer downloads the invoice, I would increment the download count by one. Before rendering the download button, I would get the download count and check if it is greater than the maximum and if so the button would not be rendered at all. Note that this depends on the invoice download being generated on the fly.
Add new attribute to Invoice (downloaded - yes/no) then when user hits download update it.