Hello,<BR><BR>Here is the code. followed by an explanation for what I am trying to do. In particular, this line is the problem I having, because it is returning rtf code instead of an actual Word doc: BinaryStream.Write byteArray &#039;Need to format<BR><BR><BR>&#060;%Response.Buffer=0 %&#062;<BR>&#060;!--#include file="global.asp" --&#062;<BR><BR>&#060;%<BR> Dim oUpload, oUploadCopy, oFiles, oForm, oFilesCopy, oFormCopy<BR> <BR> Server.ScriptTimeout = 600<BR> Set oUpload = Server.CreateObject("asppw.upload")<BR> <BR><BR> &#039;Set properties first<BR> &#039;oUpload.FileExtensionList = "txt,gif,jpg,tif,doc,bmp,xls" <BR> &#039;oUpload.MaxFileSize = 10 * 1024 * 1024 <BR> &#039;oUpload.UserDiskQuota = 20 * 1024 * 1024<BR> <BR> &#039;Now we can parse the uploaded stream<BR> On Error Resume Next<BR> oUpload.Upload<BR> <BR> ChkError "Upload failed:"<BR><BR> Set oFiles = oUpload.UploadedFileInfo<BR> Set oForm = oUpload.Form<BR><BR> Dim sFileName, lFileLength, byteArray, sDirectory<BR> <BR> byteArray = oUpload.GetUploadedFileBlob("documentFile",sFileNa me ,lFileLength )<BR> ChkError "Upload File Blob failed:"<BR><BR> Const adTypeBinary = 1<BR> Const adTypeText = 2<BR> <BR> Const adSaveCreateOverWrite = 2<BR> <BR> &#039;Create Stream objects<BR> Dim BinaryStream<BR> Set BinaryStream = CreateObject("ADODB.Stream")<BR> <BR> <BR> &#039;Specify stream type - we want To save binary data.<BR> BinaryStream.Type = adTypeBinary<BR> <BR><BR> &#039;Open the stream And write binary data To the object<BR> BinaryStream.Open<BR> BinaryStream.Write byteArray<BR> <BR><BR> Set fs=CreateObject("Scripting.FileSystemObject")<BR> sOrder = oForm("orderNumber")<BR> sVersion = oForm("versionNumber") <BR> sExtenstion = oForm("extensionNumber") <BR> &#039;sRootFolder = Server.mappath("/Fupload") + "Upload" <BR><BR> &#039;RemoteHost = Request.ServerVariables("REMOTE_HOST")<BR><BR> If Request.ServerVariables("REMOTE_HOST") = "" Then<BR> sRootFolder = ("\it1ETS2DocAppETS Documents")<BR> Else<BR> sRootFolder = ("\it1ETS2DocAppETS Test Docs")<BR> End If<BR><BR> &#039;create Order subfolder<BR> If sOrder &#060;&#062; "" then<BR> If not fs.FolderExists(sRootFolder & "\" & sOrder) Then<BR> fs.CreateFolder(sRootFolder & "\" & sOrder)<BR> End If <BR> sDirectory = sRootFolder & "\" & sOrder <BR> End If<BR><BR> &#039;create Version subfolder <BR> If sVersion&#060;&#062;"" Then<BR> If Not fs.FolderExists(sRootFolder & "\" & sOrder & "\" & sVersion) Then<BR> fs.CreateFolder(sRootFolder & "\" & sOrder & "\" & sVersion)<BR> End If <BR> sDirectory = sRootFolder & "\" & sOrder & "\" & sVersion<BR> End If <BR><BR> &#039;create Extension subfolder <BR> If sExtenstion &#060;&#062;"" then<BR> If not fs.FolderExists(sRootFolder & "\" & sOrder & "\" & sVersion & "\" & sExtenstion) Then<BR> fs.CreateFolder(sRootFolder & "\" & sOrder & "\" & sVersion & "\" & sExtenstion)<BR> End If <BR> sDirectory = sRootFolder & "\" & sOrder & "\" & sVersion & "\" & sExtenstion<BR> End If<BR><BR> &#039; Get document path on server<BR> Dim strFilePathOnServer<BR> <BR> strFilePathOnServer = sDirectory & "\" & sFileName<BR> <BR> If fs.FileExists(strFilePathOnServer) Then <BR> &#039;Response.write "1"<BR> On Error Resume Next<BR> BinaryStream.LoadFromFile strFilePathOnServer<BR> &#039;Response.write strFilePathOnServer<BR> If Err.number = 3002 Then<BR> Response.Write("3002")<BR> &#039; Throw error message in DocumentManagerProxy<BR> Response.End<BR> End If<BR> End If<BR><BR> BinaryStream.Write byteArray &#039;Need to format<BR> <BR> If not Err Then<BR> &#039; Save binary data To disk<BR> &#039;Response.write "2"<BR> BinaryStream.SaveToFile sDirectory + "\" + sFileName, adSaveCreateOverWrite<BR> &#039;Response.write "3"<BR> Response.Write sDirectory & "\" & sFileName &#039;& RemoteHost<BR> End If<BR> Set BinaryStream=Nothing<BR> <BR>%&#062;<BR><BR><BR>I am using an ASP that uses a third party active-x control to upload a<BR>file to a file server using the ADO Stream Object. It uses the<BR>FileSystemObject to create folders and files, which works fine. If the<BR>file does not exist, it saves the file (Word.doc), if it does exists,<BR>it checks to see if the file is open. If it is open, and another user<BR>is trying to save or overwrite the same file, I trap an Error 3002<BR>(document open), which another application picks up and throws an<BR>exception. If it is open, and another user is trying to save or<BR>overwrite this file, but no one has it open, it is not overwriting. I<BR>realized that what is happening is if the file is created the first<BR>time, I do a saveToFile, which works fine, and if the file is opened<BR>and the Error 3002 is trapped, it does a loadFromFile and behaves<BR>correctly as well. However, what is happening is if the file exists<BR>but is not open, it is still doing a loadFromFile, and the bytearray I<BR>am returning from the BinaryStream is only returning the file name,<BR>corrupting the word document. So, I tried creating a separate<BR>BinaryStream and did a copyTo a fresh BinaryStream - didn&#039;t work, then<BR>just a separate BinaryStream which almost works - I am getting the<BR>file to be saved and overwritten, but when I open the file it is rtf<BR>code. I tried several methods to encode it properly, but nothing I try<BR>seems to work. If I could figure out how to convert this second<BR>BinaryStream to a Word doc my problem would be solved. Is there any<BR>way to force a conversion of a bytearray returned from a Binary Stream<BR>to a Word doc? I tried doing a "Write" and "WriteToText" and that<BR>doesn&#039;t seem to work, and tried it with these constants: adTypeBinary<BR>1, adTypeText 2. If I can just get the file to convert to a Word.doc<BR>I&#039;d have it. Any help would be appreciated.<BR><BR>Thanks in advance,<BR>CB