how to display image from FTP server without download the image to the local server?
in codeigniter library there are upload, download, list_files, mirror
Asked
Active
Viewed 1,011 times
0

Agung
- 43
- 9
-
1See [Download file via PHP script from FTP server to browser with Content-Length header without storing the file on the web server](https://stackoverflow.com/q/47240635/850848). – Martin Prikryl Oct 18 '18 at 05:51
-
@Martin Prikryl Yeaaaah, SOLVED, thanks for your help, I used your linked tutorial above, and I removed header("Content-Disposition: attachment; filename=" . basename($file_path)); so I can view in browser. Firstly I load file list from FTP then use that tutorial from you Best Regard – Agung Oct 19 '18 at 01:37
2 Answers
-1
what do you mean with open from ftp?
if you mean is displaying image from hosting to web page, maybe this will help you
<img src="ftp://username:password@my_ftp_ip_address/Images/imagename.jpg"/>

Hans
- 61
- 10
-
-
-
-
Modern browsers won't load images from `ftp://` - For example Chrome does not support this since version 59: https://www.chromestatus.com/feature/5709390967472128, Firefox since version 61: https://bugzilla.mozilla.org/show_bug.cgi?id=1404744 - Use the solution from the question I've linked in a comment to the question. – Martin Prikryl Oct 18 '18 at 07:27
-
-1
$config['upload_path'] = APPPATH . 'img';

Blue
- 22,608
- 7
- 62
- 92
-
4Welcome to Stack Overflow! Thank you for this code snippet, which might provide some limited, immediate help. A [proper explanation would greatly improve its long-term value](//meta.stackexchange.com/q/114762/206345) by showing _why_ this is a good solution to the problem, and would make it more useful to future readers with other, similar questions. Please [edit] your answer to add some explanation, including the assumptions you've made. – Blue Oct 18 '18 at 10:18