TinyPortal

Development => Support => Topic started by: raid on November 08, 2008, 09:14:15 PM

Title: Download section, problem downloading
Post by: raid on November 08, 2008, 09:14:15 PM
hi,

I am having problems on my download section, sometimes happens that clicking on the Download button, nothing is downloaded.

I wrote to my host asking information about this issue, and they said that tinyportal loads the whole file to download on server memory (I think on Buffer memory, the same used for scripts). So when the buffer is full, the file isn't downloaded.

there is a way to part the files during the buffer loading, so without waste the buffer?
Title: Re: Download section, problem downloading
Post by: G6Cad on November 08, 2008, 09:49:02 PM
Nothing we can do within TP no
You need to eather ask your host to fix that issue as it's a server issue, or make the download files maller or something
Title: Re: Download section, problem downloading
Post by: IchBin on November 09, 2008, 12:27:41 AM
The only thing that is used is output buffering. If you're getting that error, it is probably because your host is over-selling their server. It sounds like they have too many clients on their server eating up the memory that their php configuration is set at. If you're host isn't willing to fix this, you should move hosts.
Title: Re: Download section, problem downloading
Post by: raid on November 09, 2008, 08:41:49 PM
right now my buffer is 24MB, is it good?
Title: Re: Download section, problem downloading
Post by: G6Cad on November 09, 2008, 08:44:32 PM
not really if you are ona shared host, you have to talk to them raid, you and them are the ones holding the answers to your question how to solve this issue you have  :-\
Title: Re: Download section, problem downloading
Post by: raid on December 03, 2008, 01:49:40 PM
hi, sorry for the late reply, now it works for file under 8mb, but what about chenge the link on Download button?

to remove the Get function, and add the direct html link to the file, so to not waste the buffer memory? is it a good idea, or is it unsafe? (about security)
Title: Re: Download section, problem downloading
Post by: G6Cad on December 03, 2008, 02:20:00 PM
Unsafe it is as the functions are removed through the security
Title: Re: Download section, problem downloading
Post by: raid on December 03, 2008, 03:13:59 PM
yes, but I don't want ot change the main code, just want to change the template, and change the download button like:

example:
Code (Old) Select
<a href="*board url*/index.php?action=tpmod;dl=getXXX"><img style="margin: 5px;" align="right" src="*images dir url*/TPdownloadfile.gif" alt="" /></a>
Code (New) Select
<a href="*board url*/*download folder*/*filename*"><img style="margin: 5px;" align="right" src="*images dir url*/TPdownloadfile.gif" alt="" /></a>

May I have some problems making these changes?
Title: Re: Download section, problem downloading
Post by: IchBin on December 03, 2008, 03:17:12 PM
Changing the button would change it for ALL download items. At this time, TP does not support having direct links.
Title: Re: Download section, problem downloading
Post by: raid on December 03, 2008, 03:38:13 PM
thx for reply, changing this, makes it possible (it's just a test):
Code (TPdlmanager.template.php) Select
<a href="*board url*/*download folder*/'.$dlitem['file'].'"><img style="margin: 5px;" align="right" src="*images dir url*/TPdownloadfile.gif" alt="" /></a>

and just change the htaccess, and add an index.php to not make browsable the tp_download folder.

My question is if it's safe, with download folder chmod 755

thx
Title: Re: Download section, problem downloading
Post by: IchBin on December 03, 2008, 03:43:33 PM
removing the htaccess will allow anyone to hotlink your downloads from any other site.
Title: Re: Download section, problem downloading
Post by: raid on December 03, 2008, 03:59:54 PM
actually I saw boards linking our "dl=get link" as on code:
http://www.darkforge.it/board/index.php?action=tpmod;dl=get115

that why I was thinking on this way, to solve at least my buffer problem for big files
Title: Re: Download section, problem downloading
Post by: G6Cad on December 03, 2008, 04:29:43 PM
Will not work, you cant have external links througn the tp:dl manager
If you remove the htaccess the security is gone.
If you do it like you describe now and keep the ht file, it will not allowe the download as they cant access the file.

There are no way you can keep it safe, and have big upload if your host doesent change the file size on the php.ini,
Title: Re: Download section, problem downloading
Post by: raid on December 03, 2008, 04:38:31 PM
ok, right now my buffer size is 24MB, what is a good size for you guys? 30-40...