Reply to Save file as attachment

Your name:

Reply:


Posted by jodleren on 03/27/07 19:32

Hi!

I talked about this some time ago somewhere else, now I am working
with this again...

I want to offer the user to save/open a file, instead of the browser
opening it by itself (as e.g. a jpeg picture would).
Looking into the advices I got at the time, I came up with this:

<?php
$filename=ExtractFileName($file); // my own function included here

header('Content-type: application/octet-stream');
header("Content-Disposition: attachment; filename=\"$filename\"");
readfile($file);
?>

It works, I get the dialog, but the white window remain.

What options do I have of closing the window, so I only have the
dialog?
My email at www.hot.ee has that option, some odd link (/attn/hex-code-
here ) which behaves as I'd like mine too.

What would people around here do?

BR
Sonnich

[Back to original 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

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