Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Serving Word documents
Message
General information
Forum:
Internet
Category:
Active Server Page
Miscellaneous
Thread ID:
00644310
Message ID:
00645810
Views:
7
From within VFP I use the following for attachments:

s = [HTTP/1.0 200 OK] + CHR(13) + CHR(10) +;
[Mime-version: 1.0] + CHR(13) + CHR(10) +;
[Content-Disposition: attachment; filename=] + sSaveAs+'.doc'+;
CHR(13) + CHR(10) + [] + CHR(13) + CHR(10)
response.write(s)
response.write(r.oleFile)

...and the following for in-browser display.


s = [HTTP/1.0 200 OK] + CHR(13) + CHR(10) +;
[Mime-version: 1.0] + CHR(13) + CHR(10) +;
[Content-type: application/msword] + CHR(13) + CHR(10) +;
[] + CHR(13) + CHR(10)
response.write(s)
response.write(r.oleFile)

HOWEVER, some versions of IE (5.0 or 5.5, I can't remember which) had a re-introduced bug which would display the contents of a word file as gibberish rather than opening word or offering it for download.

Hope this helps.


>Does anyone know how to serve up word documents from asp pages without actually putting the files in a virtual directory. This is what I tried: (asp page with a VFP dll)
>
>dll:(project = test, class = test)
>
>function GetDoc() as string
>return filetostr('c:\test.doc')
>
>endfunction
>
>
>asp:
>
>< % ERROR: 
>response.contentType="application/msword"
>set ox = server.CreateObject("test.test")
>response.BinaryWrite(ox.GetDoc())
> % >
>
>
>if I user BinaryWrite(), I get like unicode or something. Every byte has an extra 00 in front of it. If I use Write() it cuts off the document at the first offending character (probably a null). MSWord will not open the resulting file in either case.
>
>tia
Previous
Reply
Map
View

Click here to load this message in the networking platform