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 "Continue" 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!