Re: implementing downloads with php?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 02, 2015 at 02:51:32PM -0700, Jeffry Killen wrote:
> Hi;
> 
> This is new territory for me a maybe a bit off topic but
> I am interested in finding out how to implement a downloading
> mechanism with php and without using ftp (if possible).
> 
> I am understanding that http has a 'put' command. Is this the clue?
> 
> When a file is downloaded from a site, like, for instance, a source
> code file from a directory. If the user does not have an ftp client, does
> the browser negotiate an ftp connection? As an application this could
> be used for file transfer via a web site.
> 
> Thanks for time and attention
> JK

Can you describe what you want in terms of the user's experience?
What kind of files? Why can't you just use normal files in an http
directory?

When you load a webpage, you are downloading a file via http. PHP just
gives you the ability to dynamically generate / alter that file before
it gets sent (downloaded). By setting the headers appropriately, the
page can tell the browser to interpret the file as something other than
a regular webpage (e.g. an image). There are also headers that tell the
browser to prompt the user to save the page, rather than trying to
display it. Is that what you were getting at?

--Sean

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux