Dart Home | PowerTCP WebServer for ActiveX | Custom Development | Reply | PowerTCP WebServer for ActiveX Topics | Forums |
Author | Forum: PowerTCP WebServer for ActiveX Topic: Problems returning inline .PDF files |
mdyer From: Miami, FL USA Posts: 3 Member Since: 08/05/04 |
posted August 5, 2004 8:06 PM The code below works with .JPG, .GIF, .RTF, .HTM but does not work with .PDF files. However, if I just place a .PDF into the webroot and don't try to dynamically feed it back to the browser it works just fine. Any ideas? _responseBody = response.body(); _responseBody.clear(); _responseHeader = response.header(); _responseHeader.clear(); _responseHeader.add(0, strFmt("Content-Disposition: inline; filename=%1",fn), true); _responseHeader.add(0, strFmt("Content-Type: application/unknown; name=%1",fn), true); _responseBody.fileMode(1); _responseBody.fileName(strfmt('%1%2', "C:\\httptest\\",fn)); _responseBody.deleteOnDestroy(false); response.status(200); Michael |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted August 5, 2004 11:17 PM If it works fine one way, then request a page that way and save the header so you can see what it looks like. If you don't have a way to do this, you can use a sample from one of our web tools to do it. |
mdyer From: Miami, FL USA Posts: 3 Member Since: 08/05/04 |
posted August 6, 2004 9:52 AM I've done that using WFetch and the headers are identical in contents. After posting the message I found that if I change the Content-Disposition to 'attachment' instead of 'inline' that it also works (the file prompts for save in a new window). Again, the real problem is that when I choose 'inline', I can stream out all of the different file types that I've tested with except for .PDF. I did notice that there are a couple of extra bytes after the EOF in the raw stream that are not present when using 'attachment' or doing a direct request of a physical .PDF in the webroot... |
mdyer From: Miami, FL USA Posts: 3 Member Since: 08/05/04 |
posted August 17, 2004 1:06 PM Any further ideas? This is still a problem... |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted August 17, 2004 1:15 PM Sorry, I didn't have anything further to add. You should probably look into one of our other support options. Please contact sales@dart.com or call 315-790-5456 |
Reply | PowerTCP WebServer for ActiveX Topics | Forums |
This site is powered by
![]() |