Retrieving data from a ftp server

Posted on 2008-10-24
Last Modified: 2013-12-24
I have made an website for a company. This company has bought a ftp server, which can be called with ftp://1234.12 ... and is password protectet.

Now they don't want to put the data which should be accessable  /downloadable from their website, (for example .pdf oder .zip files, etc.) on their webserver but on their company's ftp server.  For example the user clicks on xxx.pdf- the xxx.pdf should be replaced on their ftp server and be retrived from there on the website!

I have no idea if this is possible at all?  And if yes, how the link could look like? for example <a herf="ftp://111.11.11/xxx.pdf>

Thanks for a convincing answer.

Question by:Shareece
  • 5
  • 3
LVL 14

Expert Comment

by:Hedley Phillips
ID: 22794796
Use the following format:

<HREF="">UWM FTP pub</A>
LVL 14

Expert Comment

by:Hedley Phillips
ID: 22794821
Sorry, try this:

<a href="">link to ftp server here</a>
<a href="">link to ftp server here</a>

Open in new window

LVL 14

Expert Comment

by:Hedley Phillips
ID: 22794826
This was tested and working on our web server connecting to our FTP server just now.  All I have done is masked the real URL.

LVL 20

Accepted Solution

edster9999 earned 250 total points
ID: 22794829
The example above would put you into the directory so you could browse for the files although it should really be :
<a href="">FTP site</a>
or the example you gave yourself
<a herf="">Document on xxx</a>
would allow you to download an individual file.  (I added a missing quote and the name and the end </a>

One place this falls down is if the ftp site is password protected.
the two examples will both try to login with
user = anonymous and password of email address (probably default to some string by the browser like

You can specify the username and password in the link like this :
<a herf="ftp://username:secretpassword@">Document on xxx</a>
But that is not exactly secure is it as you are putting the password in plain text in the web page.

A better way would be to have the files in the http area and then these can be controlled by access lists and passwords etc.

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.


Author Comment

ID: 22795285
Hello and thanks,
I still don't have the possibility to test, but I think
 <a herf="ftp://username:secretpassword@">Document on xxx</a>
could be a possilbe solution, by the time now I have to make some suggetions. Though some questions due to the last sentence:

>A better way would be to have the files in the http area
Do all  ftp-servers have a http:// area?

>these can be controlled by access lists and passwords etc.
This is fully ununderstandable for me, may you please explain a little bit more about it?
Thanks a lot

LVL 20

Expert Comment

ID: 22795336
No.   FTP servers are FTP servers.  
HTTP servers are web servers.

They can share the same files and can even act as each other but I mean you need to use the http server to do more fancy file sharing with passwords.  The FTP server is then not doing anything.
LVL 14

Assisted Solution

by:Hedley Phillips
Hedley Phillips earned 250 total points
ID: 22795346
If your server is for internal users only and you are happy to have the username and password embedded in the html then the solution posted by edster9999: is fine.

If on the other hand you want people to enter the username and password into a prompt box then just use the ftp link and miss out the user details.

Only web servers have an http area, Edster was suggesting you lock specfic directories down on the web server and using access lists and .htaccess, set it up so that users have to enter a username and password to gain access. Which would be my preferred way of doing it.

Have a read of:
LVL 20

Expert Comment

ID: 22795416
I disagree.  Most browsers (including IE and firefox) will present 'anonymous' as the username and not pop up a login box.
LVL 14

Expert Comment

by:Hedley Phillips
ID: 22795504

Had me worried there, so I double checked..

My IE (version 7) does show a prompt box, but Firefox (version 3) doesn't. So, not really good enough for use in the real world as it looks shoddy.

So, really it all depends on whether the OP is happy to have login info in the link. I wouldn't unless it was on a LAN, and would use .htaccess (as you sufggest) instead esp as it is so easily configured in Apache.

Maybe the OP also needs to question the reason why the company doesn't want the files on the web server?


Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now