Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Why codeigniter force download() incorrectly transforms the string of the archive to be downloaded?

Hi Experts!

Could you explain why codeigniter code:

 $this->load->helper('download');
 force_download($arquivo, "Ebook");

Open in new window


Tranforms the string:
$arquivo = "http://localhost/codeagro/arquivos/cesans/e_pub/Livro_melhor_alimento_ebook_2015.epub"

And produces this download (putting  "_ "  incorrectly in the string), accordingly with the picture
User generated image
What must be done to correct it ?

Thanks in advance!
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Maybe you can only download from the host that you're on, try removing the 'http://localhost/' part of the string.
$arquivo = "codeagro/arquivos/cesans/e_pub Livro_melhor_alimento_ebook_2015.epub"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

Very, very good assistanece!

Problem solved.

Thank you very much, Julian!
You are most welcome Eduardo,