Author Topic: Download Item  (Read 37807 times)

Offline HavoK XL

Download Item
« on: February 14, 2007, 01:46:15 pm »
Is it possible to code a item so that if a person purchases it, they are lead to a download link. I want to be able to sell certain resources for forum credits.

I am using SMF 1.1.2, The latest TP, and the latest (3.0) SMFSHOP.

Thanks.

Offline Daniel15

Re: Download Item
« Reply #1 on: February 17, 2007, 09:38:34 am »
There's a File Download item included with SMFShop; it may do what you want. Go to the admin panel, to "Add/Edit/Delete" items, and choose the File Download item. You type in the path to the file (preferably outside the webroot), fill in a few other settings, and then add the item.

Offline HavoK XL

Re: Download Item
« Reply #2 on: February 17, 2007, 10:06:26 am »
Are you serious oh sorry I should have double checked before posting this. Thanks I wont make the same mistake again.

Offline Daniel15

Re: Download Item
« Reply #3 on: February 17, 2007, 07:25:42 pm »
No problem ;)

Offline gmarvz

Re: Download Item
« Reply #4 on: April 11, 2007, 03:14:48 am »
hello sir.. is zip files allowed in the download? because i tried to put an image item and it is successfully downloaded.. but when i tried to put a zip file or rar file. the file cannot be opened.. i'm sure i archived it correctly. and it is even less than 1mb

Offline Daniel15

Re: Download Item
« Reply #5 on: April 12, 2007, 02:47:28 pm »
ZIP files should be working fine.
Try this item instead, and see if it works better: http://www.dansoftaustralia.net/smfshop_wiki/Items:Download_File_v2 (save the code as filedownload2.php)

Offline CRONUS

Re: Download Item
« Reply #6 on: April 16, 2007, 06:05:33 pm »
http://www.dansoftaustralia.net/smfshop_wiki/Items:Download_File_v2 (save the code as filedownload2.php)
I've tried adding .thm (SE theme file) for download.. But when I use item I download 1byte file :( it's just empty ::)

Any ideas?
« Last Edit: April 16, 2007, 06:22:42 pm by CRONUS »

Offline Emperium

Re: Download Item
« Reply #7 on: April 17, 2007, 12:51:27 am »
I'm also having troubles with downloadfile2. It's added and all but when I download my file which I set its an rar that's on the server as 32 or so mb, but I only get 0 or a few bytes downloaded after I use the item after purchasing it.

Offline CRONUS

Re: Download Item
« Reply #8 on: April 18, 2007, 03:14:46 pm »
anyone? :(

Offline Daniel15

Re: Download Item
« Reply #9 on: April 20, 2007, 10:43:52 pm »
Any errors in your error log?

Offline Emperium

Re: Download Item
« Reply #10 on: April 21, 2007, 09:59:23 am »
Any errors in your error log?

I do get an error + a link.

The link links me to a page that says:
An Error Has Occurred!
What are you doing? That ISN'T your item!!! And you even went to inv3!! Well, I thought you might try that... Stop trying to steal, SMFShop is smarter than that ;)

2: fopen(/images/banner.jpg): failed to open stream: No such file or directory
File: /home/content/E/m/p/MyUsername/html/emperium/forums/Sources/shop/items/filedownload2.php
Line: 60

Offline Daniel15

Re: Download Item
« Reply #11 on: April 21, 2007, 10:37:54 am »
Any errors in your error log?

I do get an error + a link.

The link links me to a page that says:
An Error Has Occurred!
What are you doing? That ISN'T your item!!! And you even went to inv3!! Well, I thought you might try that... Stop trying to steal, SMFShop is smarter than that ;)

2: fopen(/images/banner.jpg): failed to open stream: No such file or directory
File: /home/content/E/m/p/MyUsername/html/emperium/forums/Sources/shop/items/filedownload2.php
Line: 60
The fopen error means that the path is incorrect. The path needs to be a relative path (eg. something like ../banner.jpg, relative from the forum's directory), or an absolute path (eg. /home/content/E/m/p/MyUsername/html/emperium/images/banner.jpg).

Offline CRONUS

Re: Download Item
« Reply #12 on: April 23, 2007, 02:24:06 pm »
ok.. now it downloads BUT...
original file size is 91648 bytes and when I use an item it downloads 91649 bytes and it doesn't open :(
I get checksum error :(
« Last Edit: April 24, 2007, 02:47:54 pm by CRONUS »

Offline Daniel15

Re: Download Item
« Reply #13 on: April 28, 2007, 01:47:34 pm »
ok.. now it downloads BUT...
original file size is 91648 bytes and when I use an item it downloads 91649 bytes and it doesn't open :(
I get checksum error :(

Check that there's no whitespace at the top or bottom of filedownload2.php. The <?php should be on the very first line, and the ?> should be on the very last line (no line break after it!)

Offline CRONUS

Re: Download Item
« Reply #14 on: May 02, 2007, 03:36:34 pm »
thanks ;)
there was a [space] after ?> :)