This content has been marked as final. Show 10 replies
Well whatever code i have written is used to dump the data into Excel. But when i change the mime type to ms-word and try to dump that data it gives me the Html code of the page instead of the layout and the data. If i tries to download it into PDF file by changing the MIME type it downloads the file but when opened there is an error message like "File is corrupted". Plz let me know how i can either download into Word or PDF.
I won't advice you lots of readings, although you definatelly need to learn/understand HTTP headers, file types, file formats, Oracle Web Utilities ... etc. And your question has nothing do with PL/SQL. I do not have enough time to explain in detail, however this is workaround;
change <html> tag of the page that you associate with MS Word with;
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<meta name=ProgId content=Word.Document>
to head section of the HTML
This will help. Good luck.
Well the problem is rectified. We can change the Mime_Header itself to MS-Word.
Owa_Util.Mime_Header ( 'application/vnd.ms-word', False);
Now the problem is i dont want the user to see the Save dialog box for the file. Instead the application should be able to write the file to C:\Temp folder. Is there anyway to save files to the hard-disk without prompting. Have tried lots of options but its not working. Please help.
Due to security restrictions on the browsers, you cannot do it with any kind of server side codes (including servlets). Although you use signed applet, you may need to change security policies on client side and overwrite some methods in Java sandbox.
Imagine that if it would be that easy, you couldn't even surf on the net; all bad minded people could write codes which write malicious executables to your OS.
I am not sure if you ever got your problem resolved, but I just wanted to share my experience that is is possible to have "server" side code which will get document in Oracle or another Doc. management syste, stream it back to the client and open it (I am talking about MS Office documents) in Office application or actually inside the browser (there is a little trick with the client Windows Explorer settings to enable this, otherwise it will open as an application).
It works perfectly also for TXT files, .TIFF, .jpg , .PDF etc.
You have to be correctly setting the MIME type depending on type of the application the files was created by (I can see you are doing that);
BUT your following line :
==> is telling the client's browser that the file is coming over as attachment and therefore it will always prompt the user with OPEN, SAVE, CANCEL.
Here is a snippet of my code example [ writting the file into local temp dir]:
// set the final Content Type
Response.ContentType = ctype;
// stream and write the file out