You are here: Re: Writing to a Local File « PHP Programming Language « IT news, forums, messages
Re: Writing to a Local File

Posted by Andy Hassall on 11/21/06 20:43

On 21 Nov 2006 10:56:54 -0800, himilecyclist@yahoo.com wrote:

>We have a PHP/MySQL database application. A user would like to be able
>to run a routine to read selected data from the database and export a
>flat file to their local C: drive. After reviewing the documentation
>and posts, it is not clear how to do this, or even if it is allowed by
>the browser. If someone could point us in the right direction, we
>would greatly appreciate it.
>
>The application is hosted on a Linux server.
>The users are required to use Internet Explorer running on Windows 2000
>or XP (we also use VBScript).

You can't write to specific locations on the user's computer directly; this
would be a security nightmare. You can offer a file that the user can download
and save to the location of their choosing, however.

For example, you could use PHP to print out information in CSV (comma
separated variables) format. The user can use "Save As" or the equivalent for
their browser to save it to a file. You can use the Content-type and
Content-disposition headers to mark the type of the output, which may influence
how the browser processes it (e.g. open in Excel, save to a file, etc.)

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация