September 17th, 2013, 07:08 PM
FTP to HTTP location redirect
Is it possible to redirect from ftp to http?
for example browser loads
but ftp.server.net does not have this file and redirects browser to http location or another ftp location?
September 17th, 2013, 07:41 PM
You could try the PHP ftp_get() function first. If it returns false, then, you could try alternative options. In all cases, you could
save the image locally before displaying it depending on your needs:
In your HTML tag, you would then reference:
$image = file_get_contents('email@example.com');
September 18th, 2013, 03:58 PM
In the way you're looking for, not really.
Originally Posted by eurusd
"ftp" is a completely different protocol than "http" and it's really just because browsers are nice that they even know what to do with the "ftp" protocol. Behind the scenes the FTP protocol will be run by a completely different service than the one providing you HTTP protocol and it wouldn't even be able to tell that the request is coming from a web browser vs. a standalone FTP client.
Note, however, that the above is based your typical FTP/HTTP servers. In theory there might be FTP services out there, or one you could write yourself, that COULD detect that you're coming from a browser, but I have no idea if the browser would accept an HTTP redirect header when dealing with what it THINKS is the FTP protocol. You're kind of talking in two different languages at that point.
September 24th, 2013, 04:50 AM
Hope this helps you.
You need to look into setting up a HTTP server which supports WebDAV. I recommend Nginx or Apache. I believe WebDAV supports the FTP protocol so although you won't be able to redirect the user you will be able to serve them a file through a HTTP server rather than an FTP server.
September 25th, 2013, 01:40 AM
I think FTP to HTTP location not redirect, because there is no "redirect to a different protocol" command an FTP server can send. (At least, not one that any standard FTP client would understand.)