• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[QUESTION] Download helper and remote path

#1
Hi,

my question is:

Why if i use download helper to download a file from a remote path it don't work?

Some of you have ever had this issue?

Can you suggest me some workaround?

Thank you so much,

have a nice day.
Reply

#2
What do you mean by remote path?
Reply

#3
I mean download a file from a remote host, (different by the one from where the function is called) e.g:

https://www.foo.com/path/to/download/file

That not work and i absolutely need to download some files in this way.

The site from where i intend to download files work on code igniter too.
Reply

#4
Well the download helper can't help you with this, because

A. The data that needs to be downloaded should be passed to the function
B. The data that needs to be downlaoded is already on the file system.

The force_download function does not handle the downloading of remote files.
You will need to create your own function that uses cURL to request the file
Reply

#5
Thank you
Reply

#6
Code:
file_get_contents this will help you
Reply

#7
(05-03-2017, 07:37 PM)jagad89 Wrote:
Code:
file_get_contents this will help you

Yes, but a lot of hosting providers block file_get_contents if the request is coming from a different domain.
That is why i said he should use cURL
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.