You are here: Re: How do I send HTML and a file for 'Save-As' at the same time? « PHP Language « IT news, forums, messages
Re: How do I send HTML and a file for 'Save-As' at the same time?

Posted by Ivan Omelchenko 608308824 on 10/11/05 11:17

Daedalus.OS пишет:
> Instead of refreshing to a static files, refresh to a php file that will
> send back the file.
>
> Lets say when the user click the link it brings him to some_page.php. In
> this page you would put this code:
>
> <META HTTP-EQUIV="refresh" content="1;
> URL=http://yoursite.com/some/folder/file_gen.php">
>
> file_gen.php should now generate the file and sent it back to be downloaded.
> Without more detail about this generated file I can't tell you how exactly
> to send it back. But here is a simple exemple that would return a
> dynamically created javasctipt to be downloaded:
>
> // The file is generated and its handler is contained by $file...
> header('Content-type: application/javascript');
> header("Content-length: ".filesize($file));
> header('Content-Disposition: attachment; filename="destination_name.js"');
> readfile($file);
>
Hows about $file that weight more then 8Mb ?
You can't do it with movie, for example.

 

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

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