SMF Shop

SMFShop => Items => Topic started by: HavoK XL on February 14, 2007, 01:46:15 pm

Title: Download Item
Post by: HavoK XL 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.
Title: Re: Download Item
Post by: Daniel15 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.
Title: Re: Download Item
Post by: HavoK XL 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.
Title: Re: Download Item
Post by: Daniel15 on February 17, 2007, 07:25:42 pm
No problem ;)
Title: Re: Download Item
Post by: gmarvz 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
Title: Re: Download Item
Post by: Daniel15 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)
Title: Re: Download Item
Post by: CRONUS 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?
Title: Re: Download Item
Post by: Emperium 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.
Title: Re: Download Item
Post by: CRONUS on April 18, 2007, 03:14:46 pm
anyone? :(
Title: Re: Download Item
Post by: Daniel15 on April 20, 2007, 10:43:52 pm
Any errors in your error log?
Title: Re: Download Item
Post by: Emperium 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
Title: Re: Download Item
Post by: Daniel15 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).
Title: Re: Download Item
Post by: CRONUS 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 :(
Title: Re: Download Item
Post by: Daniel15 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!)
Title: Re: Download Item
Post by: CRONUS on May 02, 2007, 03:36:34 pm
thanks ;)
there was a [space] after ?> :)
Title: Re: Download Item
Post by: olofd on May 29, 2007, 03:37:32 pm
First off:
Thanks for a GREAT mod, I'm really impressed by you.

I can only get it to work with jpeg downloads.
not zip not mp3.

When a try with zip or mp3 i get a 1 kb file, that can't be executed.
Is there anyway to get this to work.
The path is right, the jpeg works great.

Please answer soon.. it's really frustrating.
Here is my URL:
http://www.catherinemusic.se/forum


//Olof from SWEDEN
Title: Re: Download Item
Post by: olofd on May 29, 2007, 04:03:56 pm
I fixed it with downloadphp2  document.
Please make a fix for bigegr files. up to 100mb