문제

I have one page that shows links, and I have some text data. How can I make using C++ CGI that by clicking on hyperlink "Save As" dialog will appear and certain amount of my text will be saved with user-defined path and name to the file on the users filesystem.

Actually, main question is how to show "Save as" dialog. After it, I think, everything will be easy.

도움이 되었습니까?

해결책

Just set an appropriate content-type header and then output the file.

The browser takes care of the rest. Any file type it doesn't recognize causes the Save as dialog to be displayed.

다른 팁

They key to forcing the "Save as" dialog with a MIME type the browser can display is the Content-Disposition header.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top