Solved

Retrieving data from a ftp server

Posted on 2008-10-24
9
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 14

Expert Comment

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

<HREF="ftp://ftp.uwm.edu/pub/">UWM FTP pub</A>
0
 
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

0
 
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.

0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 20

Accepted Solution

by:
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://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
 

Author Comment

by:Shareece
ID: 22795285
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
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.
0
 
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:
http://en.wikipedia.org/wiki/Htaccess
0
 
LVL 20

Expert Comment

by:edster9999
ID: 22795416
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
ID: 22795504
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Finding a job can be stressful - searches, resume tweaks, and networking events can be super boring. Luckily we're here to help you land your dream job!
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

739 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