locked
Error only on my PC - ADODB.Stream error '800a0bbc' Write to file failed. RRS feed

  • Question

  • User1898509614 posted

    This is the strangest thing... I have a group of asp files that allow a user to upload a file to our server. I normally process an upload file every other week. Well I went to process the file this morning and I recieved this error code;

     ADODB.Stream error '800a0bbc'  Write to file failed.

     At first I thought the folder on the IIS server had it's write access changed, so i checked. And it is all fine. So then just on a hunch I tried loading files from another PC here at work and sure enough the files uploaded fine with no error. So for somereason the error only happens when I try to upload the file from my PC to the Server.

    Okay so then I went outside of all logic and tried 3 different browsers on my pc, I.E.8 Beta, Firefox and Google Chrome, ALL WITH THE SAME ERROR. 

    I am at a total loss at this point. I am out of creative ideas. I thought maybe my virtual local ISS maybe the issue or my VPN connection to the server I have running however they all worked upto 2 weeks ago. I turned off my VPN and still recieved the same error.

    I will be willing to try anything anyone here can suggest. Thank you!!

    System Details

    Server Details
    Windows 2000 Server
    SQL Server

     Shawn Bordeaux 

    ***UPDATE*****

    By the way the file that is causing the error is;

    ../includes/functions/clsField.asp, line 171

    That line in that file is;
    Call lobjStream.SaveToFile(pstrFileName, adSaveCreateOverWrite)

    The clsField.asp page is called from the clsUpload.asp page which is included into my upload_process page. It is accessing that command once it tries to save the binary file to the server and that line in the upload_process.asp page is;

    objUpload("File1").SaveAs strPath

    File1 is the name for the file selected from the form input. The strPath variable is defined above that line as;
    strPath = Server.MapPath("../../hours/files") & "\" & strFileName

    and strFileName is defined by the file name selected from the form. And like I said it works fine on other PC's....



     

    Thursday, February 19, 2009 1:59 PM

Answers

  • User1898509614 posted

    It is working now! I am not sure in the logic of why this worked but here is what I did;

    I rolled back I.E. 8 to I.E.7 and then deleted all history, cookies, temp data and forms. Restarted and tried and it worked like it should on my PC. I don't have a clue why my Client was causing the problem but apparently it was and now everything is fine.

     

    Thank you for your help through this!

    Shawn

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, February 26, 2009 10:27 AM

All replies

  • User1898509614 posted

    I appreciate the quick response!

     I found that same article during my research for a solution. However the issue can not be just related to the server since when I use the webuser login on any other machine it works just fine. When i try to run the page on my desktop it has the issue. I am pretty sure it has something to do with some setting or something on my side but don't have the slightest idea on what.

     Thank you for the link!

    Thursday, February 19, 2009 3:12 PM
  • User-823196590 posted

    Is this under anonymous access or do you have to authenticate?

    Thursday, February 19, 2009 4:27 PM
  • User1898509614 posted

    It is under anonymous - webuser access... Works fine on other machines as well even connected to the same network I am on. Very strange...

    Thursday, February 19, 2009 4:34 PM
  • User-823196590 posted

    Yeah that's very strange.  Not sure what else to tell you.  All clients should work the same.  Can you show more code?  Maybe there's something we're issing there.

    Friday, February 20, 2009 7:24 AM
  • User1898509614 posted

    Okay, no problem. I will paste the code below starting with the page that the user selects the file from.

     

    Below is upload.asp
    ====================================================================

    <html> 

    <!--#include file="../../includes/style/header.asp"-->

    <H3>Upload New File</H3>
    <p>
    Browse to find the document you want to upload.
    </p>

    <FORM method="post" name="Upload" encType="multipart/form-data" action="upload_process.asp">
     <INPUT type="File" name="File1">
    <br>
     <INPUT type="submit" value="Upload">
        <input type="hidden" name="fileupload" value="True" />
    </FORM>
    </html>

    ============================================================ 

    Below is upload_process.asp

    ============================================================

    <!--#INCLUDE FILE="../../includes/functions/clsUpload.asp"-->
    <!--#include file="../../includes/style/header.asp"-->

    <%
    'Response.Expires = -1000 'Makes the browser not cache this page
    'Response.Buffer = True 'Buffers the content so our Response.Redirect will work

    If Session("UserLoggedIn") <> "true" Then
        Response.Redirect("default.asp")
    End If
    %>


    <%

    'Response.Write("path: " & pstrFileName)

    Dim objUpload
    Dim strFileName
    Dim strPath
    Dim intDocument_ID

    ' Instantiate Upload Class

    Set objUpload = New clsUpload


    ' Grab the file name
    strFileName = objUpload.Fields("File1").FileName
    strFileName = replace(strFileName,"'","_")
    ' Compile path to save file to
    strPath = Server.MapPath("../../hours/files") & "\" & strFileName

    dim fs
    Set fs=Server.CreateObject("Scripting.FileSystemObject")
    if fs.FileExists(strPath) then
      fs.DeleteFile(strPath)
    end if
    set fs=nothing


    ' Save the binary data to the file system
    objUpload("File1").SaveAs strPath ' TURN BACK ON

    ' Release upload object from memory
    Set objUpload = Nothing ' TURN BACK ON

    session("upload_status")="True"
    'Response.Write("path: " & pstrFileName)
    %>


    <h3>File Uploaded</h3>

    <P>
    The  file listed below has been uploaded. If you would  like to load the employee file into the Hours System just click &quot;Continue&quot; below.
    <br>
    Document Title<: <b><%=strFileName%></b><br>
    </P>

    <FORM method="post" name="confirm_upload" action="../upload/upload_emp_file.asp">
     <INPUT type="hidden" name="path" Value="<%=strPath%>">
     <INPUT type="hidden" name="filename" Value="<%=strFileName%>">
      
     <INPUT type="Submit" value="Continue">
    </FORM>

    </html>

    ====================================================================
    Below is the line on clsField.asp file which is an included file of clsUpload.asp - The whole page is over 300 lines of code so I will just include the part where I am recieving the error from.
    ====================================================================
    ' Save the binary data to file system
      ' Overwrites file if previously exists!
      Call lobjStream.SaveToFile(pstrFileName, adSaveCreateOverWrite)

    =====================================================================
    The error being displayed in my browser is below
    =====================================================================

    ADODB.Stream error '800a0bbc'

    Write to file failed.

    D:\INETPUB\WWWROOT\INTRANET\HOURS\ADMIN\../../includes/functions/clsField.asp, line 171

    =====================================================================
    That's it. Let me know if you can think of anything at all. Strangest thing... Thanks!

    Friday, February 20, 2009 9:08 AM
  • User1632528892 posted

    ADODB.Stream error '800a0bbc'

    Write to file failed.

    D:\INETPUB\WWWROOT\INTRANET\HOURS\ADMIN\../../includes/functions/clsField.asp, line 171

     

    Have you tried running any monitoring whilst this process is failing ? I'd suggest running Process Monitor to see if it catches any permissions related issues :

    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    Regards,

    Friday, February 20, 2009 10:10 AM
  • User1898509614 posted

    Thanks for the advice. I just tried and I don't see anything related to permissions... Strange thing is I am logging in as normal webuser the same if I use another PC. Yet when I login on my PC it gives me this error and every other one works fine. I think the only way permissions would cause that would be if the connection determined my unique pc name or ID. I doubt it is an IP since I am on a public IP with my network and when I login using other comps on the network it works fine. My computer went through some windows updates a few days ago and since it was working 2 weeks ago I am thinking maybe that had something to do with it. Not sure how but I am going to find what was updated and research into that. 

    Friday, February 20, 2009 12:06 PM
  • User-823196590 posted

    The key though is you said as far as the web site goes it's all anonymous.  It shouldn't matter where you access it from and all the code is running on the server.

    Friday, February 20, 2009 2:28 PM
  • User1898509614 posted

    Well I am glad that I'm not the only one stumped on this one. Do you think it may have something to do with me running a local IIS on my PC as a localhost for debuging code? I connecting to the webserver while running that file so I don't see how that is possible but who knows...

    Friday, February 20, 2009 2:41 PM
  • User-823196590 posted

    That shouldn't matter.

    The code is running on the web server independent of the client (or anything on your machine for that matter), and you're doing this through anonymous access.  If it works in one place it should work everywhere.

    Could it have anything to do with the file you're uploading?  Have you tried the same file from other PC's?  Have you tried different files on your PC?

    Friday, February 20, 2009 3:07 PM
  • User1898509614 posted

    I have tried numerous other files with the same result. No matter the size or the format. I am going to try one of those files on another PC. I would just send various files on the PC I was at testing it and they all worked fine no matter the file or extention accept on my PC no files work...

    Friday, February 20, 2009 3:36 PM
  • User1898509614 posted

    It is working now! I am not sure in the logic of why this worked but here is what I did;

    I rolled back I.E. 8 to I.E.7 and then deleted all history, cookies, temp data and forms. Restarted and tried and it worked like it should on my PC. I don't have a clue why my Client was causing the problem but apparently it was and now everything is fine.

     

    Thank you for your help through this!

    Shawn

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, February 26, 2009 10:27 AM
  • User-1694800989 posted

     Shawn

     

    Sorry for a late reply, I was having the same problem to do with this error on a basic ms db  and discovered that the error appears to be to do with the version of Javascript that your browser is running.

     

    The line that was causing me the problem was 

    lobjStream.Open()

     

    I have since discovered that IE 7 & 8, chrome  Safari 4 and Firefox 3.5 all error with the

    ADODB.Stream error '800a0bbc' Write to file failed.

     error but IE 6 (earlier version of java runs the files fine.  Hope that this helps in discovery of the problem.

     

    http://social.msdn.microsoft.com/Forums/en-US/netfxjscript/thread/ffcb840c-0d81-41be-9192-11284b175ca0 this is how i discovered the problem

     

    Wednesday, July 22, 2009 6:03 AM
  • User-823196590 posted

    the error appears to be to do with the version of Javascript that your browser is running

    That makes absolutely no sense - this has to do with server side ASP and not client side javascript, so the browser is irrelevant.

    Wednesday, July 22, 2009 7:46 AM
  • User-1694800989 posted

     Tom

     

    You would think so but IE6 (browser) will upload the files with no error what so ever IE7 & 8 will not so if you are saying its not client side why would that occur?

     Having looked at the  exhaustively for the past 2 weeks and found that this is the only option left.  I even went to the stage of giving everyone access on the server for the upload and write to file to work and found that it still showed an error in IE7 &* (chrome Safari and Firefox 3.5) where as a reversion in browser type allowed the file to upload.

     Would that not make you think it was browser type rather than client system.

     best regards

     

    Jonny.

     

    Wednesday, July 22, 2009 7:55 AM
  • User1898509614 posted

     

    Jonny,

    I don't understand it either but as long as I am using IE 6 or 7 it works fine. When I was having the problem before it was with IE8. I tried it on multiple machines and I would recieve the same result. Dumps with IE8 works with 6 or 7. Go figure.

     

    Thank you for the reply!

     

    Wednesday, July 22, 2009 9:24 AM
  • User-1931101754 posted

    Shawn

    I had the same problem and invetigated further and found the following link.

    http://junleashed.wordpress.com/2009/09/01/classic-asp-write-to-file-failed-error

    I hope this helps

    Cheers

    Tuna Celik

    Wednesday, September 23, 2009 11:15 AM
  • User-291827021 posted

    Hi Guys,

    I just experienced the same problem. The solution was to remove all the spaces from the filename of the uploaded file prior to saving it on the file system of the web server. Strange but true!!

    Kind Regards
    Aleem

    Monday, December 21, 2009 9:40 AM
  • User1884148175 posted

    Hi Shawn

    I had the same issue in our network. I was able to resolve this by adding the following configuration settings.

    Under Tools-Internet Options-Security-Trusted Sites(or Intranet Sites if it is an internal webpage)-Sites button
    add the domain (IE forums.iis.net)

    Also under the Tools-Internet Options-Privacy-Settings-Sites
    add the domain as an allowed site

    I also had to add the site in the compatibility view settings under
    tools-compatibility view.

    The files then uploaded successfully.

    ____________________

    Please let me know if this helped you.

     Regards

    Ben Wright

    Monday, June 27, 2011 2:49 AM
  • User569478793 posted

    To fix the problem - in the file named clsField.asp change
    It is a problem with ie8 posting the full filename to the upload page. Using this code you can use any browser.


    ' Parse File Name
    If Not InStrRev(pstrPath, "\") = 0 Then
    FileName = Mid(pstrPath, InStrRev(pstrPath, "\") + 1)
    End If

    to
    ' Parse File Name
    If Not InStrRev(pstrPath, "\") = 0 Then
    FileName = Mid(pstrPath, InStrRev(pstrPath, "\") + 1)
    Else
    FileName = pstrPath
    End If

    Thursday, November 24, 2011 11:19 AM