[ic] softgoods -- Thanks Mike H.

Paul Jordan interchange-users@interchange.redhat.com
Thu May 16 12:40:01 2002


> Hi,
>
> >De: interchange-users-admin@interchange.redhat.com en nombre de Paul
> >Jordan [paul@gishnetwork.com]
> >Enviado: lunes, 04 de marzo de 2002 20:15
> >Para: interchange-users@interchange.redhat.com
> >Asunto: RE: [ic] softgoods -- Thanks Mike H.
> >
> >Quoting Mike Heins
> >> If you expect to sell lots of softgoods, the best thing to do is make
> >> your enabling procedure provide a symlinked directory for a separate
> >> HTTP download.
> >>
> >> It can be as simple as:
> >>
> >> UserTag enable-download Order resource
> >> UserTag enable-download addAttr
> >> UserTag enable-download Routine <<EOR
> >> sub {
> >> 	my ($resource, $opt) = @_;
> >>
> >>	my $docroot = $opt->{document_root} || $::Variable->{DOCROOT};
> >> 	my $dl_dir  = $opt->{base_dir} || 'tmp_download';
> >> 	my $server  = $opt->{server}   || $::Variable->{SERVER_NAME};
> [bla, bla, bla...]
> >>
> >>
> >
> >Thanks for this great code Mike. I have decided to try and implement this
> >for the site.
> >
> >I put this usertag in catalog.cfg. I am not that good with perl, but I
> think
> >I understand what is going on here. However
> >-----------------------
> >{SERVER_NAME} -> {www.imagemogul.com}
> >
> >{DOCROOT} -> {downloads}--   I take it I should make a folder called like
> >"downloads" that is in my www directory
> >
> >{tmp_download} -- Is this a folder called tmp_download, that will be
> created
> >on the fly, inside of {downloads}
> >-----------------------
>
> It is not working for me. I´ve taken two hours trying all posible
> combinations but I can´t make it work. Where it is supposed to be the
> {downloads} directory? Under the web directory /var/www? In my
> catalog root?
> Do I have to create it first or not?
>
> All I get is a permission error when processing the page and this in my
> error.log:
>
> "localhost.localdomain bxVkzoVa:localhost.localdomain -
> [16/mayo/2002:16:33:16 +0200] reports
> /cgi-bin/reports/process.html Runtime
> error: mkdir /tmp_download: Permiso denegado at (eval 100) line 18"
>
> I´ve tried many things with permissions but nothing make it work.
> Can anyone
> help me?
>
> Thank you.
>
> José Mª
>

Jose

First off, if you are distributing small downloads, IC has functionality
built in. This code was designed to take care of many downloads of graphics,
audio, video etc, and not do it through IC.

--OK, tmp_download should be a directory immediately under your http
directory (or www directory, same thing)

--The script will "make" random directories inside that one.

--I put my actual downloads (files) directory on the same level as your www,
catalogs, cgi-bin directories.

--If I remember correctly I had to install the script as a usertag in
interchange.cfg, not catalog.cfg

--Finally, you need to call the script into action, I did in my
etc/mail_receipt, and thus the link generated gets mailed to the customer.

Check all these, if it still does not work, be sure to include how you are
trying to call the script.

Paul

PS, the only directories you don't make first are the ones the script will
make inside tmp_download