- Posts: 15
- Thank you received: 0
Fatal error:
i uploaded a file of 80 MB to a Directory outside htdocs. When User try to download it from Hikashop-link, he gets a allowed memory size error:
"Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 80310247 bytes) in /home/vhosts/5000157844/world-of-cinema.net/htdocs/libraries/joomla/filesystem/file.php on line 250"
My memory_limit = 64MB, isn't that enough to download a 80MB File?? I tried other shop-system and download-module and i can download files about 2GB without any problems. What hikashop is doing, is it first try to load file into memory?
Kind regards and thank you for help... Jo
Please Log in or Create an account to join the conversation.
Indeed, for security reasons (so that no one can download the file with just the link to it), the files uploaded in HikaShop are not directly accessible from the outside. So, the only way to access them is to go through HikaShop's code which checks that the user has the right to download it, then load that file in memory and send its content directly to the browser.
So, if you want to allow the download of files in HikaShop, your PHP memory limit needs to be above the size of the files (+ the memory used by joomla and hikashop ).
Please Log in or Create an account to join the conversation.
I understand. Unfortunately it's not possible to get memory_limt bigger than 64MB from my hoster. Is there a way to deactivate the user check and download the file directly?
Please Log in or Create an account to join the conversation.
$fileHtml = '<a href="'.hikashop::completeLink('order&task=download&file_id='.$file->file_id.'&order_id='.$this->order->order_id).'">'.$file->file_name.'</a>';
by:
$fileHtml = '<a href="'.HIKASHOP_LIVE.'media/com_hikashop/upload/safe/'.$file->file_path.'">'.$file->file_name.'</a>';
And also, delete the file .htaccess in the folder media/com_hikashop/upload/safe so that the files upload folder can be accessible from the outside.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You see, it's realy important for me.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
We use the standard joomla function for that and it first loads everything in memory before giving it back to us so that we can send it to the browser.
But we could also use directly the PHP file handling functions to load the file piece by piece and send each piece to the browser before freeing the memory before loading the next one.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
We made some modifications to handle the download by chunks instead of using joomla's built-in functions.
It's not tested so there by by some glitches. Please report to us how it goes.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.