Today we are going learn about how to write code for Opencart to download file in the front end. When we upload any file in the Opencart it calls “addUpload” model function by the controller. In the model function, it generates a random code and save this code and file name to the database. Here is the model function.
By this code, we can download the particular file from the server. Here I use a function name download in the controller to download a file from the server and call it from the view file and pass the code by get method. Here is the code
When we click on the download link then it will open a pop up window to save or open the file.
Be the first to comment.