I’ve been playing with the FileDownload resources that I’ve found, they work fine, but they link *directly* to the target file.
The catch is, I want to be able to store files out of public_html, and redirect downloads through PHP.
I’ve done this in the past using straight PHP scripts, but is there any way I can do this using Plugins? I was thinking that I should create a plugin that listens on page load, for a certain URL structure, but the Docs that I’ve found aren’t too thorough, so I’m uncertain which on-load event I should check, and I’m also uncertain as to what system variables are available to me.
#1. is what I’ve just discussed, possible as a plugin or some other type of resource within ModX? (I would be using a function such as readfile, and output mime type as needed, etc)
#2. can anyone point me to better documentation, if it exists? the documentation I’ve found on modxcms.com seems to be a bit lite.
Thanks
Yep, that would be a nice feature to have. I am also looking for some download thing that will let me hide the files out from public_html.
-
☆ A M B ☆
- 24,524 Posts
The old "docman" snippet/application that I did can do that, it stores the file metadata in the database and stores the file itself in the filesystem named "insertID.dat" where insertID is the insert id for the metadata. You can store the physical files anywhere your php has permission to access. The physical location for the file is part of the metadata.
Feel free to rip out whatever you want.
http://modxcms.com/forums/index.php/topic,383.msg6288.html#msg6288
If you use &downloadCount=`1` in FileDownload, the path to the file is base64 encoded.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
I’m not following, the files will need to be in the area where php has access to, that all.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."