Welcome Guest, Not a member yet? Register   Sign In
[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

(This post was last modified: 05-03-2017, 02:40 AM by Martin7483.)

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




Theme © iAndrew 2016 - Forum software by © MyBB