Add function force_download_large for downloading large files by reade the content with chunks so that there is no need to load the complete file into the memory before send it to the client
Add function force_download_large for downloading large files by read…
…e the content with chunks
Added description for function force_download_large
Added function force_download_large
Why not just add it as an option to the existing force_download() ?
i made a new function because force_download expects that the content of the file already is in the memory. The force_download_large expects just the filepath so that it could read it in chunks. So the behavior is totaly different.
I agree that force_download should be improved. Maybe it should be allowed to take a filepath as well as a string, with an optional parameter as a switch.
could be a solution but then the parameters will be changed and i think it is better when there will be a new function so that the upgrade from an old codeignter version to a new one will not make an error on this function
I also get your mind. Maybe we could name it download_file or something so that we have two functions here one (force_download) for downloading content which is already loaded in the memory and one (download_file) for downloading a file which is on the filesystem
The second force_download() parameter could be used as a switch for that. It's currently used for holding the file contents, but it can e.g. be set to TRUE in case we want to read it in chunks instead.
okay i will try this
modify force_download to be able to give a array with path and name k…
…ey to download this in chunks (able to download large files)
okay i have done this please review the code if this is okay i will write the user guide and the changes
the only think i have made in another way was that i check the filename. If the filename is a array then i proceed with the new feature. The array could have 2 keys (path = path to file | name = the name which is going to download) hope this is okay too
Added support for stream-like downloads of existing files to force_do…
Based on code/ideas from PR #365, #1254
See the above commit.