Force Download
This is an open discussion with 14 replies, filed under General.
Search
Doesn't work how? Is it throwing errors, or the download never happens?
Oh sorry,
Well when I put this event in my events folder in S2,
I get this when I go to Components in Symphony.
Fatal error: Cannot make static method Event::about() non static in class eventDownloadImage in /nfs/c02/h03/mnt/29224/domains/test.nicktoye.co.uk/html/wishdesigns/workspace/events/event.downloadimage.php on line 91
Any help on this?
Try changing
function about(){
to
public static function about(){
Should help.
Its giving me this error now:
Fatal error: Class eventDownload_Image contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Event::__trigger) in /nfs/c02/h03/mnt/29224/domains/test.nicktoye.co.uk/html/wishdesigns/workspace/events/event.download_image.php on line 91
Anyone else able to help here? I know Alistair is busy, so if anyone else has any experience with php events and can help.
Try changing:
if(isset($_GET['dl-image'])) return $this->trigger($_GET['dl-image']);
to
if(isset($_GET['dl-image'])) return $this->__trigger($_GET['dl-image']);
and
function trigger($path){
to
function __trigger($path){
Should help
Ok, progress
Fatal error: Cannot make static method Event::about() non static in class eventDownload_Image in /nfs/c02/h03/mnt/29224/domains/test.nicktoye.co.uk/html/wishdesigns/workspace/events/event.download_image.php on line 91
Well a different error. I think I really need to spend a couple of weeks and learn some php.
This error is actually happening when I navigate to Components section in Symphony.
Isn't that the same error you had previously?
Oh yeah, I was editing an old version. Well I have just edited the newer version, and I am getting a different error:
Fatal error: Declaration of eventDownload_Image::__trigger() must be compatible with that of Event::__trigger() in /nfs/c02/h03/mnt/29224/domains/test.nicktoye.co.uk/html/wishdesigns/workspace/events/event.download_image.php on line 91
Try this one out. Has improved code and seems to work fine on my local server.
Right, does it work with PDF downloads?
I guess I should have called it "Download Anything." Try this DS out. I've tweaked it slightly.
Thanks Alistair, this is great. Be excellent if this event was stored in a library for others to use. For me, its things like this that really make me want to stay loyal to this great product.
Create an account or sign in to comment.
I have noticed that this event doesn't work with S2?
Is there much that needs to change? Or does anyone have any working method to hand?
Cheers