I'm working on a College Application project.

I want to ask on how to download the files that previously uploaded by user.

Here's the clear view : 1. User will upload the files. 2. Controller will handle the request and save the name of the files into database. 3. ?? How admin can download the file ???

I try to access the localhost/system/files/upload.doc but doesn't got any luck.

Member Avatar

LastMitch

Here's the clear view : 1. User will upload the files. 2. Controller will handle the request and save the name of the files into database. 3. ?? How admin can download the file ???

You can take a look at this code called MediaView which is no longer in used (to get an idea how it works):

http://api.cakephp.org/2.2/source-class-MediaView.html#23-242

As of now since MediaView which is no longer in used there is a new function called Sending files:

http://book.cakephp.org/2.0/en/controllers/request-response.html#cake-response-file

I try to access the localhost/system/files/upload.doc but doesn't got any luck.

I think you need to modify the permission on the htaccess file (I'm not sure it's going to work).