ThatRickGuy
Programmer
Hey Guys,
I'm working on a site that the user will upload a file to, a bunch of work will be done to that file, then the user will be given the option to view some data once the work is done.
To make it look smooth I do all of the work to the file in a seperate thread, then use an AJAX timer/update panel to update the page on the client side as the work progresses server side.
Unfortunately, I ran into a problem when I tried testing it. Running in the VS2005 environment (localhostort/site/page) it works flawlessly. But when I try to browse to it hosted on IIS5 (localhost/site/image) I get "Cannot access a closed file."
Here's a trimmed up copy of the code:
It appears to be some kind of difference between the VS2k5 host and IIS, but I'm not sure of a way to make IIS behave better. Any thoughts, configuration or code whys?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.
I'm working on a site that the user will upload a file to, a bunch of work will be done to that file, then the user will be given the option to view some data once the work is done.
To make it look smooth I do all of the work to the file in a seperate thread, then use an AJAX timer/update panel to update the page on the client side as the work progresses server side.
Unfortunately, I ran into a problem when I tried testing it. Running in the VS2005 environment (localhostort/site/page) it works flawlessly. But when I try to browse to it hosted on IIS5 (localhost/site/image) I get "Cannot access a closed file."
Here's a trimmed up copy of the code:
Code:
Protected Sub page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
'initial load stuff here
Else
'initial submit
If Not Me.Timer1.Enabled = True Then
If Not fdPresentation.PostedFile Is Nothing And _
fdPresentation.PostedFile.ContentLength > 0 Then
'display the update panel
Me.up1.Visible = True
Dim del As New del_DoWorkInBackground(AddressOf DoWorkInBackground)
'Me.ifPresentation is the HTMLInputFile
del.BeginInvoke(Me.ifPresentation, Nothing, Nothing)
Else
Response.Write("Please select a file to upload.")
End If
End If
End If
End Sub
Private Delegate Sub del_DoWorkInBackground(ByRef ifPresentation As htmlinputfile)
Private Sub DoWorkInBackground(ByRef ifPresentation As htmlinputfile)
Dim m_blStatus As New BulletedList
Try
Me.Timer1.Enabled = True
'...
[COLOR=red]ifPresentation.SaveAs(SaveLocation)[/color]
catch exc as exception
'error reporting
end try
end sub
end class
It appears to be some kind of difference between the VS2k5 host and IIS, but I'm not sure of a way to make IIS behave better. Any thoughts, configuration or code whys?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.