>  From: Sumit Upadhyay <[EMAIL PROTECTED]>
>  Subject: [twincling] how ftp works
>  Sent: 11 Dec '06 18:50
>  
>  Hi All:
>  
>  I want to know about hows ftp works in web pages developed from PHP /Perl.
>  I provided one link (ftp) to download a file from a web page like following
>  .
>  You may download the file from:
>  ftp://xxxx.xxxx.com/mainDir/YbSkinSelectRes.dll
>  
>  its working fine.
>  The File is located, not  in mainDir/  but its in  mainDir/result/
>  This Dir is the server dir where all the files reside that server uses.
>  So my question is how ftp searches  the file & give option save file ?
>  Is it depends on any settings from Server(IIS)?
>  
>  --
>  Sumit
>  

Hi Sumit:

This is a very common situation encountered when developing webapps that require
access to content from an NFS mount or a mapped drive.

One possible solution is to write a ftp handler application which can process a 
normal HTTP request.

Here is an example,

The absolute path to the content on the machine is say
   /home/sumit/internal/content/g345d/file.pdf

The path fragment (A) that needs to be handled is
    internal/content/

The generated path pragment (B) is
    g345d/file.pdf

The developer writes an ftphandler which takes path fragment (B) as input (via 
GET request)
and then delivers the content after placing in appropriate headers in the HTTP 
output stream.

For the end user, the url looks like this in HTML code
    <a href='ftphandler.php?getfile=g345d/file.pdf'>file.pdf</a>
 
Hope this helps.

thanks
Saifi.

Reply via email to