We help IT Professionals succeed at work.
Get Started

Forcing SaveAs Dialog in Delphi ISAPI

APE47
APE47 asked
on
572 Views
Last Modified: 2013-11-23
Hi,
This may be a simple error on my part, but I cannot seem to get the SaveAs dialog to be invoked from within my ISAPI dll.

I've tried placing a TSaveDialog on the TWebModule, and dynamically creating the TSaveDialog but in both cases I just get a beep when I try the Execute method.

I want to allow the user to save a file I have open in a stream. I can save the file using GetTempPath and Stream.SaveToFile, so I know the file is OK, but I want the user to set the destination.

Looking around the web I thought I'd find a possible solutions by setting the Response.ContentType := 'application/unknown'  or 'application/octetstream', or setting Response.SetCustomHeader('Content-Disposition','filename='abc') but still the document (JPG/PDF) is opened on screen rather than saved

Any help would be appreciated, as I'm running out of hair to pull out

Thanks in advance
Andy
Comment
Watch Question
President
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE