Solved

Retrieving data from a ftp server

Posted on 2008-10-24
9
290 Views
Last Modified: 2013-12-24
Hello,
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.

0
Comment
Question by:Shareece
  • 5
  • 3
9 Comments
 
LVL 14

Expert Comment

by:Hedley Phillips
Comment Utility
Use the following format:

<HREF="ftp://ftp.uwm.edu/pub/">UWM FTP pub</A>
0
 
LVL 14

Expert Comment

by:Hedley Phillips
Comment Utility
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

0
 
LVL 14

Expert Comment

by:Hedley Phillips
Comment Utility
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.

0
 
LVL 20

Accepted Solution

by:
edster9999 earned 250 total points
Comment Utility
The example above would put you into the directory so you could browse for the files although it should really be :
<a href="ftp://111.11.11.11/pub/">FTP site</a>
or the example you gave yourself
<a herf="ftp://111.11.11.11/xxx.pdf">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@111.11.11.11/xxx.pdf">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.

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Shareece
Comment Utility
Hello and thanks,
I still don't have the possibility to test, but I think
 <a herf="ftp://username:secretpassword@111.11.11.11/xxx.pdf">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


0
 
LVL 20

Expert Comment

by:edster9999
Comment Utility
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.
0
 
LVL 14

Assisted Solution

by:Hedley Phillips
Hedley Phillips earned 250 total points
Comment Utility
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:
http://en.wikipedia.org/wiki/Htaccess
0
 
LVL 20

Expert Comment

by:edster9999
Comment Utility
I disagree.  Most browsers (including IE and firefox) will present 'anonymous' as the username and not pop up a login box.
0
 
LVL 14

Expert Comment

by:Hedley Phillips
Comment Utility
mmmh.

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?





ie.gif
ff.gif
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 101
How search webpage "viewable text" only 1 25
Do we need servers??? 5 120
Stupid git question 2 19
This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…

744 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