Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-04-16 17:42:47

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: [request] Pay before download

I’m very anxious to have this kind of plugin inside Txp! :)

Offline

#17 2009-04-16 18:08:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,440
Website GitHub

Re: [request] Pay before download

duchamp wrote:

I’m very anxious to have this kind of plugin inside Txp! :)

I’ll do my best when I get a spare day or three to work on it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#18 2009-04-16 18:12:07

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: [request] Pay before download

Bloke wrote:

I’ll do my best when I get a spare day or three to work on it.

Don’t worries! I know how this things work! It’s a lot of work and effort to help a community, I really appreciate that and obviously I can wait (but with anxiety! LOL)

Cheers!

Offline

#19 2009-04-16 19:19:15

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: [request] Pay before download

Bloke wrote:

I’ve not tried smd_remote_file in anything higher than TXP 4.0.6 for starters!

I use smd_remote_file successfully with TXP 4.0.8 :-)

I have plans for smd_remote_file to be able to handle this exact functionality — though without you having to manually upload the files — but right now I think the files must be ‘available’ because smd_remote_file is built around http:// access. If it works otherwise I’d love to know of your success with this technique.

Well, my idea was to upload the files in a new directory (say /photos) in my site, not remotely, and then set smd_remote_file to use: http://mysite/photos/photo1.jpg
I have just tested it, everything seems fine :-)

I have also found that I cannot access (gives 404 error, tried suggestions here) this:
http://mysite/file_download/5/photo1.jpg.link
but this is for the better, isn’t it? :-)

-Kostas

Offline

#20 2009-04-16 22:19:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,440
Website GitHub

Re: [request] Pay before download

kostas45 wrote:

I use smd_remote_file successfully with TXP 4.0.8 :-)

Good to know, thanks for the report.

upload the files in a new directory (say /photos) in my site, not remotely, and then set smd_remote_file to use: http://mysite/photos/photo1.jpg
I have just tested it, everything seems fine :-)

Excellent. But I still think you’ll find it’s accessible directly from the URL if you type in http://mysite/photos/photo1.jpg. So it’s no good for ‘secure’ (aka ‘hidden’ in this case) downloads, unless you inhibit directory listings and either:

  1. obfuscate the filename so it becomes something random like http://mysite/photos/a574f9e9239cb9a120dc.jpg, or
  2. generate the file on the fly and delete it after it’s been downloaded (which assumed the download doesn’t fail partway through)

The system I have planned allows files to be stored in either:

  • a remote location
  • the ‘files’ dir
  • a subdir of ‘files’
  • any other dir under your site root
  • any dir outside docroot for true ‘secure’ downloads which are in no way accessible via the browser address bar

and still all be managed via TXP’s Files tab. At least in theory; not written enough of the code to test it yet :-) The latter group of files require special intervention; the plugin manages the handshaking and security aspects of an exchange so it is not possible for someone to obtain the file without the authorisation code. The only missing thing is the PayPal trigger that I’m hoping IPN can deliver, possibly via yab_shop’s checkout_thanks_site (if the plugin can be made to work that way; I don’t know if it does yet).

I have also found that I cannot access… http://mysite/file_download/5/photo1.jpg.link

So how do you intend to send the file to the user if they can’t get at it? Or how will you communicate the direct URL they need to download the file? (e.g. http://mysite/photos/photo1.jpg)? As far as I remember — it’s been a long time — the .link file is supposed to “resolve” to the ‘remote’ file you have assigned. Whether the remote file is truly remote (fileden, etc) or ‘remote’ in relation to the files dir is immaterial; if you give a .link file in the file_download URL it should resolve as long as the file is accessible via http://. If it doesn’t, it’s a bug in the (current) plugin and I’ll need to fix it!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#21 2009-04-17 10:28:25

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: [request] Pay before download

Bloke wrote:

But I still think you’ll find it’s accessible directly from the URL if you type in http://mysite/photos/photo1.jpg. So it’s no good for ‘secure’ (aka ‘hidden’ in this case) downloads, unless you inhibit directory listings and either:

  1. obfuscate the filename so it becomes something random like http://mysite/photos/a574f9e9239cb9a120dc.jpg, or

According to Linklok URL’s manual (which btw can be downloaded by anyone), this is exactly what Linklok URL is doing by producing links which are authenticated using MD5.
And also recommends to create an obscure dir name (instead of /photos above) for the download files, if in webroot.

The system I have planned allows files to be stored in either:

  • a remote location
  • the ‘files’ dir
  • a subdir of ‘files’
  • any other dir under your site root
  • any dir outside docroot for true ‘secure’ downloads which are in no way accessible via the browser address bar
    and still all be managed via TXP’s Files tab. At least in theory; not written enough of the code to test it yet :-)

Wow! This covers everything I dreamed of :-)

The latter group of files require special intervention; the plugin manages the handshaking and security aspects of an exchange so it is not possible for someone to obtain the file without the authorisation code. The only missing thing is the PayPal trigger that I’m hoping IPN can deliver, possibly via yab_shop’s checkout_thanks_site (if the plugin can be made to work that way; I don’t know if it does yet).

Haven’t used yab_shop before, maybe trenc could shed light on here.

So how do you intend to send the file to the user if they can’t get at it? Or how will you communicate the direct URL they need to download the file? (e.g. http://mysite/photos/photo1.jpg)?

Again, this is Linklok URL’s job, as described above.
Basically, what smd_remote_file does, is providing hooks with the TXP system, so that yab_shop’s product properties and article (download) files can be associated, if a way is found that is :-)

As far as I remember — it’s been a long time — the .link file is supposed to “resolve” to the ‘remote’ file you have assigned. Whether the remote file is truly remote (fileden, etc) or ‘remote’ in relation to the files dir is immaterial; if you give a .link file in the file_download URL it should resolve as long as the file is accessible via http://. If it doesn’t, it’s a bug in the (current) plugin and I’ll need to fix it!

That’s how I thought it would work as well, it looks like a plugin bug, yes.

-Kostas

Offline

#22 2011-04-06 00:49:44

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: [request] Pay before download

Too much time without entering the TXP Forums and tonight I’m here looking for the same thing:
any solution to use Textpattern to sell digital goodies?
Paypal implemented their new Digital Goods what is a great notice, so … anything new about this subject inside Textpattern?

Thx in advance!

Offline

Board footer

Powered by FluxBB