0

I'm trying to automatically update my images contained with a img tag on my website.

I've created a FTP server and used the ftp_connect() function to connect to it, however after reading this page I don't know which function will allow me to display the image without the user having to download the image.

Also if this is completely wrong or there's an easier way could someone tell me?

Thanks.

TomBrad95
  • 31
  • 1
  • 7
  • 1
    exactly how do you propose to display an image on a user's computer WITHOUT them having downloaded the image in the first place? – Marc B Jul 13 '16 at 17:04
  • Possible duplicate of [How to display images from ftp-server on html page?](http://stackoverflow.com/questions/34894426/how-to-display-images-from-ftp-server-on-html-page) – James Paterson Jul 13 '16 at 17:09
  • After looking at that page, I just didn't get it! Could someone explain it better? – TomBrad95 Jul 13 '16 at 17:22
  • FTP means *"File Transfer Protocol"* - it just moves files from one computer to another. It doesn't provide any technique at all for displaying or viewing images. You normally view images on another machine using HTTP protocol within a web-browser like Internet Explorer or Safari. If you want to view images in a remote machine that way, you'll need to use FTP to put the images in the place where `Apache` (or `lighttpd` or `nginx`) is serving them from. – Mark Setchell Jul 13 '16 at 18:07
  • I know FTP means File Transfer Protocol and that it is displayed in HTML, all I'm asking is that instead of a folder named images all the images are in the FTP server and can be displayed in line on the HTML page without the user downloading them!! – TomBrad95 Jul 13 '16 at 20:10

1 Answers1

0

If I understand you correctly, you're talking about this... <img src="ftp://username:password@my_ftp_ip_address/Images/imagename.jpg"/> I have a similar problem like this right now. The code above will work in any browser except firefox. I'm trying to find a way to make it work in firefox. Also note: There's a security issue with this. It doesn't effect me, but be aware that if anyone looks at your code, they will see the password to your ftp site. .... About the firefox issue. I was able to make it work by putting it in an iframe instead of an img tag, but I'd really like to know why I can't get it to work with IMG SRC in firefox.

CheeseFlavored
  • 1,922
  • 1
  • 21
  • 28