Download "Content-Disposition" to Excel
530085Jul 2 2007 — edited Jul 2 2007I have a user who was having trouble getting an Excel file to download properly. When she clicked on the web link created by my procedure, her Excel file would download all the columns into one field. For myself, and most other users, it downloads normally with all the columns and fields where they should be. She was also missing the prompt asking if you wanted to open or save the file. It was just downloading to Excel right away.
Now, the user said she did not have this problem with all her Excel downloads, just this one. So I looked at the program that had the Excel download that worked for her and compared it to the one that didn't.
And there was a difference.
The download that did NOT work for her had this line of code: htp.print('Content-Disposition: inline; filename='||v_file_name1);
The download that DID work for her had this code: htp.print('Content-Disposition:attachment; filename='||v_file_name1);
In the program that wasn't working for her I replaced the part of Content-Disposition with "attachment" instead of "inline". That seemed to do it. Nothing more needs to be done, but I dont' really know why it worked. I can't seem to find a definintion of what an "inline" Content-Disposition means vs. "attachment". Anyone know? Thanks!
Oh, and here's the surrounding owa_util code in case that helps make it more clear where it was coming from:
owa_util.MIME_HEADER('text/comma-delimited', FALSE);
htp.print('Content-Disposition:attachment; filename='||v_file_name1);
owa_util.HTTP_HEADER_CLOSE;
Message was edited by:
user527082