Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Retrieving data from a ftp server

Posted on 2008-10-24
Medium Priority
Last Modified: 2013-12-24
I have made an asp.net 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="ftp://ftp.uwm.edu/pub/">UWM FTP pub</A>
LVL 14

Expert Comment

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

<a href="ftp://ftpserver.domain.com/dir1/dir2/test.pdf">link to ftp server here</a>
<a href="ftp://ftpserver.domain.com/dir1/dir2/test.pdf">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.

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 20

Accepted Solution

edster9999 earned 1000 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 user@firefox.com)

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.


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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As computers become more powerful, jobs will be replaced with artificial intelligence, leaving no place in the future for humans in the workforce. In the oncoming technological revolution, the staggering change to human mind labor will prove the ski…
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

572 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