Developing new module

13 years 1 month ago #160003 by MarkRS
Replied by MarkRS on topic Re: Developing new module
Ok, well that all made it relatively simple, thank you.

I'm "almost finished". That "almost" that is still a big jump that I can't make.

I've implemented my display tab in the user profile area, it's just right.
Each line is a link to download a file, with some preprocessing.
The link and the preprocessing appears to be fine, but I can't get it to offer me a download dialogue. Any easy handy hints?

TIA
Mark

Please Log in to join the conversation.

13 years 1 month ago #160026 by krileon
Replied by krileon on topic Re: Developing new module
Download dialogs aren't really an easy task as you have to serve the users a page with the appropriate headers to classify it as a download. Otherwise by default it'll try to open which is fine unless you're serving PDF/Txt like documents. Best approach is to use jQuery and perform an ajax request for the download. I think there's actually a jQuery plugin for this making it even easier. Best results found simply with searching.

lmgtfy.com/?q=php+download+dialog


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: MarkRS

Please Log in to join the conversation.

13 years 1 month ago #160051 by MarkRS
Replied by MarkRS on topic Re: Developing new module
Yes, it's a bit fiddly.
I'm trying to use the Joomla "PDF" function as a guide (I'm pushing a pdf file to the browser but need to do a couple of other things too, like record the download &tc &tc.).
However, the Joomla stuff runs through the normal flow, which I'm having a bit of problem following. I'll look out the JQuery stuff, thanks. ("lmgtfy"? ROFL! I'd not seen that before : )

Please Log in to join the conversation.

13 years 1 month ago - 13 years 1 month ago #160054 by krileon
Replied by krileon on topic Re: Developing new module

I'm trying to use the Joomla "PDF" function as a guide (I'm pushing a pdf file to the browser but need to do a couple of other things too, like record the download &tc &tc.).

I see, in this case you'll need a custom download parser to handle this.

An example is having the file download.php placed somewhere (where downloads stored?) and call that file with parameters (www.example.com/downloads.php?file=123.zip) then parse the parameters and obtain that specified file. In downloads.php you'd handle the headers to classify it as a download as well as handle the queries to log the click/download, etc..

I honestly believe you're better off using an extension like Docman to serve your downloads, why re-invent the wheel when 1 click away you've download management? Docman has grouping based permissions so it'd be easy to limit who can download what based off those groups.

("lmgtfy"? ROFL! I'd not seen that before : )

It's quite handy, many folks forget to Google before posting.. very helpful thing Google is. :P


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 1 month ago - 13 years 1 month ago #160071 by MarkRS
Replied by MarkRS on topic Re: Developing new module

krileon wrote: I see, in this case you'll need a custom download parser to handle this.


That bit's quite easy. I copied stuff from the SimpleBoard plugin to create a link with parameters and re-extract them.

I haven't found anything that allows me control at the file level easily. I haven't looked very hard at DocMan, it's true. However, then I want to stamp the PDF files according to who downloads them. I want to keep track of who downloads files and how often. Neither of these are particularly hard, they are all done. It's just getting Joomla and download links sorted out.

I think I'm probably just a bit short on headers :S

It's quite handy, many folks forget to Google before posting.. very helpful thing Google is. :P


:)
I did Google first, honest. And checked here specifically.

Thanks again.
Mark

Please Log in to join the conversation.

13 years 1 month ago #160139 by krileon
Replied by krileon on topic Re: Developing new module

I haven't found anything that allows me control at the file level easily. I haven't looked very hard at DocMan, it's true. However, then I want to stamp the PDF files according to who downloads them. I want to keep track of who downloads files and how often. Neither of these are particularly hard, they are all done. It's just getting Joomla and download links sorted out.

Docman offers downloads as well as logging who downloaded what via Download Logs and Statistics. Everything you're wanting/needing is already available in a download extension. If still wanting to use custom integration can offer best of luck but beyond that there's nothing I can do, sorry. Without the headers being set correctly the file will not be seen as a download through browsers.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.200 seconds

Facebook Twitter LinkedIn