J
Julia B
Hi, I've got an ASP.NET 2.0 application where I need to open files. I had it
working on my local webserver, with the files on my C drive.
However I've now published the application to our production web server
(Windows 2003 SP2) and the files are on a shared folder within that web
server.
If I try and run the application on the webserver the transmit file just
times out. If I try and run the application in debug mode (i.e on my local
webserver connecting to the files on the production web server) the transmit
file causes an instance of Word or Excel as relevant to open but the file is
blank.
The files concerned are very very small, just a few bytes in some cases, so
I know it's not a file size issue. I've also checked permissions and the
ASPNET account has the correct permissions (I've checked this by saving files
to the same shared folder using the application).
Does anyone have any hints? Here's the code:
Response.Buffer = False
Response.Clear()
Response.ClearHeaders()
'now get the record name
If e.CommandName = "OrigRecord" Then
filePath = selectedRow.Cells(9).Text
filePath = Global.Global_asax.calRecordFilePath & filePath
Response.AppendHeader("Content-Disposition", "attachment;filename=" &
System.IO.Path.GetFileName(filePath))
Response.ContentType = "text/csv"
Else
filePath = selectedRow.Cells(10).Text
filePath = Global.Global_asax.calReportFilePath & filePath
Response.AppendHeader("Content-Disposition", "attachment;filename=" &
System.IO.Path.GetFileName(filePath))
Response.ContentType = "application/msword"
End If
'now we've got the full path for the file, open it
Response.TransmitFile(filePath)
Response.End()
Thanks in advance
Julia
working on my local webserver, with the files on my C drive.
However I've now published the application to our production web server
(Windows 2003 SP2) and the files are on a shared folder within that web
server.
If I try and run the application on the webserver the transmit file just
times out. If I try and run the application in debug mode (i.e on my local
webserver connecting to the files on the production web server) the transmit
file causes an instance of Word or Excel as relevant to open but the file is
blank.
The files concerned are very very small, just a few bytes in some cases, so
I know it's not a file size issue. I've also checked permissions and the
ASPNET account has the correct permissions (I've checked this by saving files
to the same shared folder using the application).
Does anyone have any hints? Here's the code:
Response.Buffer = False
Response.Clear()
Response.ClearHeaders()
'now get the record name
If e.CommandName = "OrigRecord" Then
filePath = selectedRow.Cells(9).Text
filePath = Global.Global_asax.calRecordFilePath & filePath
Response.AppendHeader("Content-Disposition", "attachment;filename=" &
System.IO.Path.GetFileName(filePath))
Response.ContentType = "text/csv"
Else
filePath = selectedRow.Cells(10).Text
filePath = Global.Global_asax.calReportFilePath & filePath
Response.AppendHeader("Content-Disposition", "attachment;filename=" &
System.IO.Path.GetFileName(filePath))
Response.ContentType = "application/msword"
End If
'now we've got the full path for the file, open it
Response.TransmitFile(filePath)
Response.End()
Thanks in advance
Julia