Force file download

I am trying to create a page with downloadable pdf documents.
The link should open a download dialog box to prompt the user to
save or open the file, notjust open the file in the browser.
I am using the code below which seems to work, except the
files are unopenable. Acrobat says they are either a not supported
file type or a damaged file.

On a windows server, cfcontent requires an absolute path.
Updated (working) code below.

Similar Messages

  • Force file download? Content-Disposition?

    Hello,
    I recently started using an X-Serve with OS X 10.4.8 installed.
    This is my media server, and I'm trying to configure it to force a file download dialog when an mp3 file is pulled.
    I used to do this by using an .htaccess file with the following:
    <FilesMatch "*.mp3">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </FilesMatch>
    But it doesn't seem to work now.
    Do I have to add a new Content Handler? If so, what do I put to force a file download?
    Thanks very much

    See Oracle Metalink,
    ..Oracle Portal Technical Forum,
    ....Subject: PORTAL - uploading files (file attachments) with file names.
    This message thread outlines javascript code that automatically captures the filename during an upload.

  • Force file download for IE9 on Azure Blob Storage

    Hello,
    I am trying to use Azure Blob Storage as a location for secure file downloads using Shared Access Signature. Everything is working very well, however the problem I am having is I am trying to allow the user to save files from the browser and I have all browsers
    except IE9 working.
    Reviewing this question,
    What content type to force download of text response?
    this works well when I can control all of the headers, however in Azure Blob Storage, I have set the Content-Type to application/octet-stream and this allows all browsers except IE to ask the user to save the file, IE simply opens the file. It appears that
    known file types will open (example .jpg, .wmv etc…).
    In Azure, I have found no way to set
    Content-Disposition: attachment;filename="My Text File.txt"
    Is there a way, using Azure Blob Storage, to use IE to download any file directly from Azure Blob Storage?
    Thanks in advance.

    Hi,
    Actually, we can't set Content-Disposition for blobs, and I can't think of any other workarounds. From my experience, in most case IE's behavior is fine. I would like to know why you have to prompt a download? The user can see the text file, and
    if they wish to save it locally, they have more than one way to do that (copy paste, save file, etc.). If they simply want to read the text and then forget it, that's also fine. They don't even have to download it and then double click a local file to read
    the content.
    If you have to modify the behavior, the only workaround I can think of is to use a web role as an intermediate bridge, and add the Content-Disposition from your web role.
    Best Regards,
    Ming Xu.
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact
    [email protected]
    Microsoft One Code Framework

  • How to force file download message box appear????

    I download file from oracle
    how to set response header to make download message box appear??????
    I just see lots of :
    ���?������ Y�Dl?��>��hn��?g�x~����?7���}��h`a�F��?P?!P��*�X��?/?U ��A?|?/??$�T=��t ��?^!i��f��/?]?�c��7?�UZ�Gz?��SbU��p���Q�T������?��e JyN�/�X^��w��/Bo�k�O��������^��$��?�������yg���C(??[�[+?��R�����p��?te@?��o��?M:D�_s#h�����H��g/?�nE"�PQI���A!��bE������?C`A�������?V��2�^��<�NK?[��k�k$??yJ>?sg-hm�AW(���S��?l[��[���� ��?dL4��6!�N��*���N?Q2?���JoP��>|�sb�_�^�_����~�r��X
    on the screen
    I am a chinese, happy new year everyone!

    and the file.size() is semicode, meaning there isnt a function for it. So you might end up with something like this
         response.setContentType( "application/zip" );
         String fileName = Globals.getAttachmentLocation() + readFile;
         response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
         BufferedInputStream bufferedInputStream = new BufferedInputStream( new FileInputStream( fileName ) );
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         int start = 0;
         int length = 1024;
         byte[] buff = new byte[length];
         while ( bufferedInputStream.read( buff, start, length ) != -1 ) {
              byteArrayOutputStream.write( buff, start, length );
         bufferedInputStream.close();
         response.setContentLength( byteArrayOutputStream.size() );
         response.getOutputStream().write( byteArrayOutputStream.toByteArray() );
         response.getOutputStream().flush();

  • File download dialog box problem!

    Hi,
    How do you force file download message box to use specified file name instead of JSP or servlet name.
    I am using:
    // code in attachment.jsp
    <%
    response.setContentType(mimeType.trim());
    response.setHeader("Content-Disposition","attachment;filename=\""+attachmentViewBean.getAttachmentName()+ "\"");
    %>
    With the above code, browser first pop up file download dialog box informing
    'You are downloading the file:[attachment.jsp] from host. Would u like to open the file or save?'
    I want the file name that I had specified in setHeader("Content-disposition","attachment;filename=resume.doc") to appear(i.e. resume.doc) in above dialog box and not the servlet name.
    Any suggestions/tips on this?
    Your help would be greatly appreciated.
    Thanks,
    Yogesh

    For saving the document I have used -
    res.setHeader("Content-disposition", "attachment; filename="+ FileName );
    and it is working very fine, it saves the document with name specified in FileName
    For opening the file in browser without any prompt-
    res.setHeader("Content-disposition", "inline" );
    For setting the content type -
    try {
         if(FileType.equalsIgnoreCase("pdf")) contentType = "application/pdf";
         if(FileType.equalsIgnoreCase("doc")) contentType = "application/msword";
         if(FileType.equalsIgnoreCase("rtf")) contentType = "application/msword";
         if(FileType.equalsIgnoreCase("gif")) contentType = "image/gif";
         if(FileType.equalsIgnoreCase("jpg")) contentType = "image/jpeg";
         if(FileType.equalsIgnoreCase("html")) contentType = "text/html";
         if(FileType.equalsIgnoreCase("htm")) contentType = "text/html";
         if(contentType == null){
         contentType="text/plain";
         res.setContentType(contentType);
    } catch (Exception e){
              out.println("Exception while setting content type");
              out.println("Exception : " + e);
              return;
    Hope this helps

  • How do I force a file download from a folder above the root?

    I am new to ColdFusion and need some help. I set up a virtual folder on my website and then mapped in the CF9 admin panel to a "Docs" folder above my root, where I would like to store sensitive documents. CF tags are enabled.
    I know that my mapping is set up correctly, because when I set up a cfm page with the following code, I can successfully download the file:
    <cfheader name="Content-Disposition" value="attachment; filename=Calendar.pdf">
    <cfcontent type="application/pdf file=/Docs/Calendar.pdf">
    But what I need is to create one cfm age that will be able to handle downloads of multiple files types and names from the folder above my root.
    I then found Duke Snyder's solution on an older forum for the "click link and download file" question where he suggests making a "download.cfm" page with the following code:  I did this, and named the file "download.cfm"
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "foo/bar" file = "/Docs/#Url.FileName#">
    Then Duke suggests: "Now I pass the FileName through the Url and it WILL ask if you want to open or download the file. We accomplish this by making up an eronious file type."
    I then set up a password-protected page on the site that lists the titles of a number of documents, with links to the virtual folder, where they can be downloaded.  One of the links, which goes to "Calendar.pdf" I constructed as: "download.cfm?FileName=Calendar.pdf"  When I click on the link, I get the popup box that says "Do you want to open or save this file?  With the name listed as: "download.cfm?Filename=Calendar_pdf"
    When I click "Save", I get the message: "Internet Explorer cannot download download.cfm from www.... Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found. Please try again later.
    I must have constructed the link incorrectly. Any ideas?  Thanks in advance for your help.

    I am trying to force the download of pdf files from a folder above the root.  The file below is named "download.cfm"  I pass the name of the file (Calendar.pdf) in the URL link, as follows: download.cfm?filename=Calender.pdf
    In the ColdFusion admin panel, I mapped a folder in the root "Docs"  to point to a folder with a different name above the root.   I have tried the code below, which was generously supplied by another member of this forum, but it does not seem to recognize the CF mapping. Do I need to use another CF Tag for the mapping to working correctly?
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "application/pdf" file = "/Docs/#Url.FileName#">
    Thanks for your help

  • Force flash to open file download box in front of the flash movie

    Folks,
    I'm making a dvd title using flash to auto start when people
    pops the dvd disc in.
    I have a button 'Click here to download the movie' and
    clicking the button should pop up a file download box so people can
    save the movie file(.mov) to their desktop.
    Problem is that the file download box shows up behind the
    flash movie so people won't be able to see the download box since
    it's hidden behind the flash. This is critical since I intend the
    flash to open as a full-screen mode.
    Is there a way to force the flash to open the download box in
    front of the flash movie?
    I tried getURL and fscommand ("exec", "filename.exe") and
    even fileReference commands to try different way of linking the
    movie file, and they all open download box behind the flash.
    Please help~~~

    Please do not post the same topic in multiple forums. The
    only thing I can suggest is when they click on the button to
    download, you take flash out of full screen while they download the
    video, you can use fileReference to control and monitor the
    download. Use a listener object to monitor when download is
    complete, then set flash back to full screen.
    How are you scripting the full screen?

  • Filename on file download from jsp

     

    This may help:
              ----- Original Message -----
              From: "Erik Lindquist" <[email protected]>
              Newsgroups: weblogic.developer.interest.jsp
              Sent: Wednesday, June 28, 2000 6:20 PM
              Subject: How to dynamically display images in JSPs
              > This took a little while to figure out so I thought I'd share. After
              > doing some research I was led to the following approach on how to load
              > images from an Oracle database into a JSP:
              >
              > The "main" JSP:
              >
              > <HTML>
              > <head>
              > <title>Image Test</title>
              > </head>
              > <body>
              > <center>
              > hello
              > <P>
              > <img border=0 src="getImage.jsp?filename=2cents.GIF">
              > <P>
              > <img border=0 src="getImage.jsp?filename=dollar.gif">
              > <P>
              > world
              > </body>
              > </HTML>
              >
              >
              > And this is the image getter:
              >
              > <% try {
              > response.setContentType("image/gif");
              > String filename = (String) request.getParameter("filename");
              > java.sql.Connection conn =
              > java.sql.DriverManager.getConnection("jdbc:weblogic:pool:orapool"); //
              > connect to db
              > java.sql.Statement stmt = conn.createStatement();
              > String sql = "select image from testimage where filename = '" +
              > filename + "'";
              > java.sql.ResultSet rs = stmt.executeQuery(sql);
              > if (rs.next()) {
              > byte [] image = rs.getBytes(1);
              > java.io.OutputStream os = response.getOutputStream();
              > os.write(image);
              > os.flush();
              > os.close();
              > }
              > conn.close();
              > }
              > catch (Exception x) { System.out.println(x); }
              > %>
              >
              >
              > The thing to note is that there are no <%@ page import="..." %> or <%@
              > page contentType="..." %> tags - just the single scriptlet. It
              > seems that for every "<%@" the weblogic compiler sees it puts
              > out.print("\r\n"); statements in the generated java source.(???) I
              > don't know much about how browsers work but I think that once it sees
              > flat ascii come at it it treats everything that follows as text/plain
              > which is incorrect for the binary stream that's being sent. Another
              > work around was to set out = null; but that's kind of ugly and might
              > produce server errors. The real fix is to write a bean to handle images
              > which I'll work on next (does anybody have any hints on how to do
              > that?)
              Cameron Purdy
              [email protected]
              http://www.tangosol.com
              WebLogic Consulting Available
              "Ramesh" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > Even I could download the files with this technique, I couldn't open the
              file downloaded. It seems the file is getting currepted during tranfer.. Can
              u help me in this regard please?
              >
              > Thank u
              > Ramesh
              >
              > [email protected] (Anders B. Jensen) wrote:
              > >In an Web-application written in Java Server Pages it should be possible
              > >for the user to download data from the web-server. The data will never
              > >exist as a file on the web-server, only in the PrintWriter object, out.
              > >To force the Internet Explorer (IE) to show the download dialog window
              > >the Contenttype of the HTTP-header have been set to "html/transfer". The
              > >question is:
              > >
              > >Is it possible to set the filename appearing in the download dialog
              > >appearing on the client?
              > >
              > >
              > >Below is a listing of the source-code:
              > >
              > ><%@ page extends="com.beasys.portal.admin.PortalJspBase"%>
              > ><jsp:useBean id="download" scope="session" class="dk.lec.DownloadData" />
              > >
              > ><%
              > > String tmpstr;
              > > response.setContentType("html/transfer");
              > > out.clear();
              > > tmpstr=download.getStrbuffer().toString();
              > > out.println(tmpstr.trim());
              > >%>
              > >
              > >
              > >Anders B. Jensen
              > >Consultant, Research & Development
              > >LEC AS
              > >
              > >Remove the SPAMLESS to mail me.
              >
              

  • Is there a way to force a download option?

    Hello
    My boss asked me this question: is there a way to force a
    link (PDF in this case) to open the dialog box for an option of
    save to file or open?
    Thanks
    Rob

    > My boss is asking for it... no other reason
    If you are willing, you could educate your boss a bit and
    explain that PDFs
    are a 3rd party file format...not a native web format. As
    such, they are
    interacted with outside of the default settings of common web
    browsers. This
    means that the default behavior of a link to a PDF is going
    to be different
    on everyone's own machine and based on things like user
    preferences,
    installed plug-ins, installed browser extensions and
    installed 3rd-party PDF
    viewing applications.
    Any link can be downloaded via right-clicking a link in any
    browser (well,
    except maybe the iPhone...can you 'right click' on the
    iPhone?)
    Using a ZIP file can fix the 'force a download' request, but
    usually those
    types of requests that come from people that don't really
    know how to use a
    computer, so you're gambling that they'll know what to do
    with a ZIP file.
    -Darrel

  • Mulitple File Downloads in AIR

    ** EDIT **
    Just tested. I was throttling the downloads to 28kbps. Think
    there must be a timeout on the file functions, as when it was reset
    without throttling, the file downloaded 100%. Is there a way to
    reset/remove a timeout on a URLStream?
    Good morning all.
    I'm having trouble with a file download component I've
    written. It worked fine debugging, but when testing an installed
    version of the application, there seems to be a problem with the
    loop, and files not completely downloading.
    I have tested, and one file in the loop is writing to the
    directory (event.complete action) at about 45%.
    How can I check if the total bytes downloaded is the same as
    total available, and if not, force it to carry on the download for
    that particular item?
    The code for the page is below:
    public function Update():void {
    if(appModel.fileArrCol.length > 0) {
    var urlReq:URLRequest = new
    URLRequest(appModel.fileArrCol[0][1].toString());
    trace(urlReq.url);
    urlStream = new URLStream();
    urlStream.addEventListener(IOErrorEvent.IO_ERROR,
    onStreamError);
    urlStream.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    urlStream.addEventListener(Event.COMPLETE,
    fileTransferHandler);
    urlStream.load(urlReq);
    private function fileTransferHandler(event:Event):void {
    urlStream.readBytes(fileData, 0, urlStream.bytesAvailable);
    var fileLoc:String = appModel.fileArrCol[0][2].toString() +
    appModel.fileArrCol[0][0].toString();
    var file:File =
    File.applicationStorageDirectory.resolvePath(fileLoc);
    var fileStream:FileStream = new FileStream();
    fileStream.addEventListener(Event.CLOSE, fileClosed);
    fileStream.addEventListener(IOErrorEvent.IO_ERROR,
    onStreamError);
    fileStream.openAsync(file, FileMode.WRITE);
    fileStream.writeBytes(fileData, 0, fileData.length);
    fileStream.close();
    trace("File " + appModel.fileArrCol.length + ": " +
    appModel.fileArrCol[0][0].toString());
    private function onStreamError(event:IOErrorEvent):void{
    //Alert.show("Invalid Username or Password!","Warning");
    this.showCloseButton =true;
    btnUpdate.visible = true;
    trace(event.text);
    private function progressHandler(event:ProgressEvent):void {
    /* bar.setProgress( Number(event.bytesLoaded /
    event.bytesTotal), 1 ); */
    bar.setProgress(event.bytesLoaded,event.bytesTotal);
    progLabel.text = "Downloading " +
    Math.round(event.bytesLoaded / 1024) + " kb of " +
    Math.round(event.bytesTotal / 1024) + " kb " +
    (appModel.fileArr.length - 1) + " files remaining";
    private function fileClosed(event:Event):void {
    // run a progress bar or sqlite table update here
    appModel.fileArrCol.removeItemAt(0);
    if (appModel.fileArrCol.length > 0){
    Update();
    } else {
    progLabel.text = "Uploads Complete";
    var thisServerVersion:String =
    appModel.fileDownloadServerVersion;
    var thisDescription:String =
    appModel.fileDownloadDescription;
    var thisDownloadDate:String = appModel.fileDownloadDate;
    // store the file download details within the database table
    if(appModel.checkFileDownloadHistory(thisServerVersion).valueOf()
    > 0) {
    // a record matches the version number in the xml. do
    nothing
    } else {
    appModel.storeFileDownloadHistory(thisServerVersion,thisDescription,thisDownloadDate);
    // close the box down
    PopUpManager.removePopUp(this)
    public function init():void{
    btnUpdate.visible = false;
    this.showCloseButton = true;
    if (appModel.urlAvailable){
    Update();
    }else{
    Alert.show("No Network Connection Detected","Message");
    this.showCloseButton =true;
    btnUpdate.visible = true;
    public function titleWindow_close(evt:CloseEvent):void {
    PopUpManager.removePopUp(this)
    The application reads the number of files from an xml file on
    the server. That works fine, but I think the loop is wrong. In
    debug, it traces the file names without a problem
    Please please please can someone help me? I need to get this
    sorted and resolved by this lunchtime.
    Many thanks in advance,
    Matt

    http://kb.mozillazine.org/Unable_to_save_or_download_files
    Separate Issue;
    Your System Details shows;
    Installed Plug-ins
    Shockwave Flash 16.0 r0
    Shockwave Flash 11.9 r900
    Having more than one version of a program may cause issues.
    Grab the uninstaller from here:
    '''[http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html Uninstall Flash Player | Windows]'''
    '''[http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html Uninstall Flash Player | Mac]'''
    Then reinstall the latest version.
    Flash Player '''v16.0.0.257<br>https://www.adobe.com/products/flashplayer/distribution3.html'''
    Shockwave Director '''v12.1.6.156 http://get.adobe.com/shockwave/'''

  • Servlet forces a download of pdf instead of displaying it

    Hi,
    First I apologize for the cross posting, but I'm in need of an answer ASAP, and I'm not sure what forum best suits this problem. I have a servlet that retrieves a pdf from a database and displays it. This servlet has been working fine up until recently, when I tested it on SunOne App server. I have been using Tomcat to build my app, and recently deployed it to SunOne to test it on there, but now when I try and view it, I'm forced to download and save the file to my computer. Having tested this servlet app on Jserv and Tomcat(both working fine), I'm guessing that the problem might reside in some kind of SunOne server configuration. Is this possible? I know very little about that side of things. Any help would be much appreciated.
    Thanks

    Are u saying that the computer with SunOne installed should have Acrobat installed aswell, even if I'm accessing the application from another computer which has acrobat installed. Here is some of the code:
    long length = 0;
    int len = 0;
    Blob b = resultset.getBlob(1) ;
    InputStream is = b.getBinaryStream();
    length = b.length();
    byte[] x = new byte[10*1024];
    resp.setContentType("application/pdf");
    resp.setContentLength((int)length);
    DataOutputStream o = new DataOutputStream(resp.getOutputStream());
    while ((len = is.read(x)) != -1)
    o.write(x, 0, len);
    o.flush();
    o.close();
    Thanks

  • While attempting to install the latest iTunes update, version 10.5.3, I encountered an issue. I was forced to download this update manually which, after restarting my Windows 7, did not install properly. How do I get it to install this update?

    While attempting to install the latest iTunes update, version 10.5.3, I encountered an issue. I was forced to download this update manually which, after restarting my Windows 7, did not install properly. How do I get it to install this update?

    The installer should have gone into your Apple Software Update folder:
    C:\USERS\<user name>\AppData\Local\Apple\Apple Software Update
    Right mouse click the msi file and select INSTALL

  • XML File download through an iview

    Hi All,
    I've written an iview that builds up the data for an xml file and tableview report. The should be able to click a link on the iview and a window pops up and they can save the XML data to a local file.
    I have two problems, the first is I am unsure how to pass the large amount of data from the first iview to the second "Download" iview. It is too big to fit as a form parameter. I'm hoping to add it to the component session. Do you think this will work?
    The second problem is the download itself. I've created a basic component with a doContent method. I've tried setting the content type to "Application/octet-stream" by using the following code :
    public class ecDownloadComponent extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              PortalComponentContentType pct = new PortalComponentContentType("APPLICATION/OCTET-STREAM");
              response.setContentType(pct);
              response.write("<xml>hello</xml>");
    All I get is an HTML page with the data in.
    Any ideas how I force the download?
    Cheers
    Richard

    Hi Richard,
    1.) If the complete data which should be downloadable is built in the first iView, it is no problem to add it to the component session. "Size doesn't matter"
    What happens "physically" if you add something to a session? In fact, a <i>reference</i> to your (small or incredible fat) object is added into a hashtable or something similar.
    (Excurs: That's why objects in sessions are called "live", because if you get a reference to an object of a session and manipulate this object with it's methods, the object in the session is manipulated, because it's the same object; that's the reason why you don't have to "update" such an object into the session).
    So you don't have to worry about using the double amount of memory, because you are not.
    2.) For iViews to be something different than HTML, put all the stuff into the overridden method <i>protected void doOnNodeReady(IPortalComponentRequest request, IEvent event)</i>, retrieve the original HttpServletResponse via <i>HttpServletResponse response= request.getServletResponse(true);</i> and set the ContentType on this.
    The trick is to be "early enough" in the sense that the content type must not have been set before.
    With this, just implement an empty <i>doContent</i> method and put the rest of your download logic in the method stated above.
    Just one more info, not needed here, but maybe interesting in this context: If you want do produce PDF's in this way, you have to be sure to put the PDF data "fast enough" into the output stream, otherwise the PDF-Reader could get stuck. This means <i>first</i> setting all data into a memory buffer and then sending this into the outputstream (and not calculating the data "while sending").
    Hope it helps
    Detlev

  • Content file download failed.

    I haven't been able to find anything on this anywhere. Trying to get Windows 8.1 Update (KB2919355) to download, but it keeps failing.  I'm using WSUS 3.2 on Server 2008 R2, 156GB free space on E drive.
    This error has been occurring since April, but all other updates are downloading fine.  If I sort by file status, only the 3 updates for 8.1, 8.1 x64, and 2012 R2 are stuck trying to download.
    Anyone have any ideas?
    Event ID 364:
    Content file download failed. Reason: An attempt was made to move the file pointer before the beginning of the file.
    Source File: /msdownload/update/software/crup/2014/02/windows8.1-kb2919355-x64_66955196a82751d1c8d9806d321487562b159f41.psf Destination File: E:\WSUS\WsusContent\41\66955196A82751D1C8D9806D321487562B159F41.psf.

    Anyone know if this is still an issue in WSUS 3.2:
    http://support.microsoft.com/kb/974500/en-us ?
    All existing WSUS v3.2 hotfixes were rolled up into KB2720211 (so they are also present in KB2734608, KB2828185 and KB2938066).
    [Edit] Ehhhh. but that's actually a WUA issue that's *not* been resolved to my knowledge. It's not really a bug, just a fact of how the WUA caches content.
    Method #2, however, should be the option of FIRST choice. DECLINE the update, and force a client detection. But note that even this methodology is designed to be a *reactive* response, only if the client freaks out.
    Then, once the client knows the update is no longer available, you can re-approve the update, and the WUA will RE-download the content that is available. (Of course.. what's also not written in that KB article is that the 'issue' only applies to updates
    that actually HAVE EIFs that the client can download!) :-)
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • TMG NIS definition files download but update fails during installation

    Hi Folks,
    Runnning Forefront TMG build 7.0.9193.500
    When attempting to update the NIS definition files, the files download but fail to install and the following message is logged in the TMG alert section:
    "Definition Updating Failed
    Description: An error occurred during an attempt to check for, download, or install definition updates on the server ServerName.
    The failure is due to error: 0x80240022"
    When looking in the windowsupdate.log file, it appears that there is a permissions problem encountered during the update process (WARNING: ExtractUpdateFiles failed with 0x80070005)
    Here are the full contents of the C:\Windows\windowsupdate.log file logged during the update process:
    =========== 
    Logging initialized (build: 7.5.7601.17514, tz: -0700) 
    ===========
      = Process: C:\Program Files\Microsoft Forefront Threat Management Gateway\UpdateAgent.exe
      = Module: C:\Windows\system32\wuapi.dll
    -- START -- 
    COMAPI: Search [ClientId = Forefront TMG]
    <<-- SUBMITTED -- COMAPI: Search [ClientId = Forefront TMG]
    ** START ** 
    Agent: Finding updates [CallerId = Forefront TMG]
      * Online = Yes; Ignore download priority = No
      * Criteria = "(IsInstalled = 0 and IsHidden = 0 and CategoryIDs contains 'ae4483f4-f3ce-4956-ae80-93c18d8886a6' and CategoryIDs contains 'e0789628-ce08-4437-be74-2495b842f43b')"
      * ServiceID = {00000000-0000-0000-0000-000000000000} Third party service
      * Search Scope = {Machine}
    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\9482F4B4-E343-43B6-B170-9A65BC822C77\muv4wuredir.cab:
     Microsoft signed: Yes
    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\9482F4B4-E343-43B6-B170-9A65BC822C77\muv4wuredir.cab:
     Microsoft signed: Yes
    Checking for updated auth cab for service 7971f918-a847-4430-9279-4a52d1efe18d at http://download.windowsupdate.com/v9/microsoftupdate/redir/muauth.cab
    Validating signature for C:\Windows\SoftwareDistribution\AuthCabs\authcab.cab:
     Microsoft signed: Yes
    Validating signature for C:\Windows\SoftwareDistribution\AuthCabs\authcab.cab:
     Microsoft signed: Yes
    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\7971F918-A847-4430-9279-4A52D1EFE18D\muv4muredir.cab:
     Microsoft signed: Yes
    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\7971F918-A847-4430-9279-4A52D1EFE18D\muv4muredir.cab:
     Microsoft signed: Yes
    +++++++++++ 
    PT: Starting category scan  +++++++++++
      + ServiceId = {7971F918-A847-4430-9279-4A52D1EFE18D}, Server URL = https://www.update.microsoft.com/v6/ClientWebService/client.asmx
    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\7971F918-A847-4430-9279-4A52D1EFE18D\muv4muredir.cab:
     Microsoft signed: Yes
    Validating signature for C:\Windows\SoftwareDistribution\WuRedir\7971F918-A847-4430-9279-4A52D1EFE18D\muv4muredir.cab:
     Microsoft signed: Yes
    +++++++++++ 
    PT: Synchronizing server updates  +++++++++++
      + ServiceId = {7971F918-A847-4430-9279-4A52D1EFE18D}, Server URL = https://www.update.microsoft.com/v6/ClientWebService/client.asmx
      * Added update {A1395633-49F7-4A6C-AEE9-7166E952BCFD}.100 to search result
    Update {E27A995F-A0EC-4A58-8FCA-B8E190D68D27}.100 is pruned out due to potential supersedence
      * Added update {72ABF509-5624-4520-A70D-BD25033E2423}.100 to search result
      * Found 2 updates and 4 categories in search; evaluated appl. rules of 28 out of 35 deployed entities
    END  **  Agent: Finding updates [CallerId = Forefront TMG]
    >>-- 
    RESUMED  -- COMAPI: Search [ClientId = Forefront TMG]
      - Updates found = 2
    END  --  COMAPI: Search [ClientId = Forefront TMG]
    -- START -- 
    COMAPI: Download [ClientId = Forefront TMG]
      - Forced: No; Download priority: 3
      - Updates in request: 2
      - ServiceID = {7971F918-A847-4430-9279-4A52D1EFE18D} Third party service
    <<-- SUBMITTED -- COMAPI: Download [ClientId = Forefront TMG]
    ** START ** 
    DnldMgr: Downloading updates [CallerId = Forefront TMG]
      * Call ID = {4328BC7B-E197-42E3-BFF2-96BCCAA86280}
      * Priority = 3, Interactive = 1, Owner is system = 1, Explicit proxy = 1, Proxy session id = -1, ServiceId = {7971F918-A847-4430-9279-4A52D1EFE18D}
      * Updates to download = 2
    Title = Definition Update for Microsoft Forefront Threat Management Gateway (Network Inspection System 4.32)
    UpdateId = {A1395633-49F7-4A6C-AEE9-7166E952BCFD}.100
    Bundles 1 updates:
    {8614B1DC-943B-425B-B995-9F0FCD2E961D}.100
    Title = Definition Update for Microsoft Forefront Threat Management Gateway (Network Inspection System 11.39.0.0)
    UpdateId = {72ABF509-5624-4520-A70D-BD25033E2423}.100
    Bundles 1 updates:
    {8A1DD8C3-CF18-45BE-9F0D-68DBD4A53409}.100
    DnldMgr: New download job [UpdateId = {8614B1DC-943B-425B-B995-9F0FCD2E961D}.100] 
      * All files for update were already downloaded and are valid.
    DnldMgr: New download job [UpdateId = {8A1DD8C3-CF18-45BE-9F0D-68DBD4A53409}.100] 
      * All files for update were already downloaded and are valid.
    END  **  Agent: Downloading updates [CallerId = Forefront TMG]
    >>-- 
    RESUMED  -- COMAPI: Download [ClientId = Forefront TMG]
      - Download call complete (succeeded = 2, succeeded with errors = 0, failed = 0, unaccounted = 0)
    END  --  COMAPI: Download [ClientId = Forefront TMG]
    -- START -- 
    COMAPI: Install [ClientId = Forefront TMG]
      - Allow source prompts: Yes; Forced: No; Force quiet: No
      - Updates in request: 2
      - ServiceID = {7971F918-A847-4430-9279-4A52D1EFE18D} Third party service
      - Updates to install = 2
    <<-- SUBMITTED -- COMAPI: Install [ClientId = Forefront TMG]
    ** START ** 
    Agent: Installing updates [CallerId = Forefront TMG]
      * Updates to install = 2
    Title = Definition Update for Microsoft Forefront Threat Management Gateway (Network Inspection System 4.32)
    UpdateId = {A1395633-49F7-4A6C-AEE9-7166E952BCFD}.100
    Bundles 1 updates:
    {8614B1DC-943B-425B-B995-9F0FCD2E961D}.100
    Title = Definition Update for Microsoft Forefront Threat Management Gateway (Network Inspection System 11.39.0.0)
    UpdateId = {72ABF509-5624-4520-A70D-BD25033E2423}.100
    Bundles 1 updates:
    {8A1DD8C3-CF18-45BE-9F0D-68DBD4A53409}.100
    WARNING: failed to calculate prior restore point time with error 0x80070002; setting restore point
    WARNING: LoadLibrary failed for srclient.dll with hr:8007007e
    Preparing update for install, updateId = {8614B1DC-943B-425B-B995-9F0FCD2E961D}.100.
    =========== 
    Logging initialized (build: 7.5.7601.17514, tz: -0700) 
    ===========
      = Process: C:\Windows\system32\wuauclt.exe
      = Module: C:\Windows\system32\wuaueng.dll
    :: START :: 
    Handler: Command Line Install
      : Updates to install = 1
      : WARNING: Command line install completed. Return code = 0x8007000d, Result = Failed, Reboot required = false
      : WARNING: Exit code = 0x8024200B
    END  ::  Handler: Command Line Install
    Preparing update for install, updateId = {8A1DD8C3-CF18-45BE-9F0D-68DBD4A53409}.100.
    FATAL: Failed to copy file from C:\Windows\SoftwareDistribution\Download\57418eecd53e3e067a25056fe4892d0420c6ac8a to C:\Windows\SoftwareDistribution\Download\Install\mpips-fe.exe (hr = 80070005) after 10 retries
    WARNING: ExtractUpdateFiles failed with 0x80070005.
    FATAL: Failed to delete file \\?\C:\Windows\SoftwareDistribution\Download\Install\mpips-fe.exe (hr = 80070005) after 0 retries
    REPORT EVENT: {F363E0CC-B0F5-4B28-8C27-631AC7CAD332}
    2012-03-15 11:32:37:899-0700
    1
    REPORT EVENT: {336A98E0-0970-4297-B746-1A8A4B45F3CF}
    2012-03-15 11:32:40:099-0700
    1
    END  **  Agent: Installing updates [CallerId = Forefront TMG]
    Triggering Offline detection (non-interactive)
    ## START ## 
    AU: Search for updates
    <<## SUBMITTED ## AU: Search for updates [CallId = {9BB9AE78-F80D-4236-AD77-8E261ABB97E0}]
    CWERReporter::HandleEvents - WER report upload completed with status 0x8
    WER Report sent: 7.5.7601.17514 0x80070643 A1395633-49F7-4A6C-AEE9-7166E952BCFD Install 101 Unmanaged
    CWERReporter finishing event handling. (00000000)
    ** START ** 
    Agent: Finding updates [CallerId = AutomaticUpdates]
      * Online = No; Ignore download priority = No
      * Criteria = "IsInstalled=0 and DeploymentAction='Installation' or IsPresent=1 and DeploymentAction='Uninstallation' or IsInstalled=1 and DeploymentAction='Installation' and RebootRequired=1
    or IsInstalled=0 and DeploymentAction='Uninstallation' and RebootRequired=1"
      * ServiceID = {7971F918-A847-4430-9279-4A52D1EFE18D} Third party service
      * Search Scope = {Machine}
    >>-- 
    RESUMED  -- COMAPI: Install [ClientId = Forefront TMG]
      - Install call complete (succeeded = 0, succeeded with errors = 0, failed = 2, unaccounted = 0)
      - Reboot required = No
      - WARNING: Exit code = 0x00000000; Call error code = 0x80240022
    END  --  COMAPI: Install [ClientId = Forefront TMG]
      * Found 0 updates and 68 categories in search; evaluated appl. rules of 1058 out of 2009 deployed entities
    END  **  Agent: Finding updates [CallerId = AutomaticUpdates]
    >>## 
    RESUMED  ## AU: Search for updates [CallId = {9BB9AE78-F80D-4236-AD77-8E261ABB97E0}]
      # 0 updates detected
    END  ##  AU: Search for updates [CallId = {9BB9AE78-F80D-4236-AD77-8E261ABB97E0}]
    No featured updates notifications to show
    Successfully wrote event for AU health state:0
    Successfully wrote event for AU health state:0
    REPORT EVENT: {03FCFF25-6464-4C3E-A939-3E46A39BED6A}
    2012-03-15 11:32:45:262-0700
    1
    CWERReporter::HandleEvents - WER report upload completed with status 0x8
    WER Report sent: 7.5.7601.17514 0x80070005 72ABF509-5624-4520-A70D-BD25033E2423 Install 101 Unmanaged
    CWERReporter finishing event handling. (00000000)
    Since it seemed to help some folks that were having trouble downloading the NIS updates, I have also tried downloading the updates with (winhttp) Proxy authentication on and off.
    I have also tried recreating the C:\Windows\SoftwareDistribution folder (Stop wuauserv; Rename folder; Start wuauserv; Folder recreated)
    Still no luck. Any help or direction you can provide is much appreciated.
    Cheers,
    John

     
    Hi,
    Thank you for the post.
    I did some research regarding error “0x80070005”, you may perform the following steps and see if it helps:
    Step 1: Verify DCOM security
    1. Click Start, click Run, type Dcomcnfg, and then click OK.
    2. Expand Component Services, and then expand Computers.
    3. Right-click My Computer, and then click Properties.
    4. Click the COM Security tab.
    5. Under Access Permissions, click Edit Default.
    6. Verify that the following accounts are listed:
    7. If any one of these accounts is missing in the Access Permission box, follow these steps:
    a.  Click Add, click Advanced, and then click Locations.
    b.  In the Locations box, click the Local_Computer_Name, and then click OK.
    c.  Click Find Now.
    d.  Press CTRL, click the required account names, and then click OK two times.
    e.  In the Group or User names box, click an account that you added, click Local Access in the Permissions for Account_Name box, and then click to select the check box in the Allow column.
    f.  Repeat step 7e for all the accounts that you just added, and then click OK.
     Step 2: Verify DCOM default properties
    1. Click the Default Properties tab.
    2. Verify that the following configuration:
    • The Enable Distributed COM on this computer check box is selected.
    • In the Default Authentication level box, Connect is selected.
    • In the Default Impersonation level box, Identify is selected.
    3. Make any required changes, and then click OK.
    4. Restart the computer.
    http://social.answers.microsoft.com/Forums/en-US/vistawu/thread/29d7f9d1-56cd-42f3-bd44-7de8448ef70e
    http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/95edbee4-a75c-48ad-91d1-5316a96f9567
    Regards,
    Nick Gu - MSFT

Maybe you are looking for