PDA

View Full Version : .NET HtmlInput "Security" Issue?


dillieo
04-29-2004, 07:42 PM
Greets all,

I have a simple CSV parsing .NET web app where the user uploads the file
and the web app does the magic. I have been able to get it to run on my
personl workstation and our sanbox, but as soon as I move it to the
pre-production server, I am getting a really weird exception being thrown
(Object Reference not set to the instance of an object) at the command
where the actual upload is taking place. Here is the snapshot of the code:

If EncryptedPassword = ADMINSTRATORPASSWORD Then
' Get file that user has uploaded and store locally
Try
FilePath = Server.MapPath("/sails") & "/" &
ConfigurationSettings.AppSettings("ConvertDummyIDInput")
fileDummyID.PostedFile.SaveAs(FilePath)

Catch fnfex As FileNotFoundException
UNLV.SysApps.Exception.CustomException.LogException(CType(fnfex,
Exception), True)
lblSystemError.Visible = True
' Abort any further processing
Return
Catch dnfex As DirectoryNotFoundException
UNLV.SysApps.Exception.CustomException.LogException(CType(dnfex,
Exception), True)
lblSystemError.Visible = True
' Abort any further processing
Return
Catch ex As Exception
UNLV.SysApps.Exception.CustomException.LogException(ex, True)
lblSystemError.Visible = True
' Abort any further processing
Return
End Try

When the exception gets logged. It balks on the line where the fileDummyID
does its SaveAs routine. I've even tried hard coding the path to upload the
file to with no avail.

Now we've checked write permissions to the aspnet_wp app so they can write
to the folder and everything is running smoothly elsewhere. Any ideas on
where the hangup could be? The only thing we (my and the System Admin) are
thinking of currently is that after he ran IIS Lockdown, there could be a
hidden setting that is still locking the process out? Any ideas?

Thanks in advance for any ideas you may have!
- Sean

A1ien51
04-29-2004, 09:40 PM
Just an idea off the top of my head and not sure if you said you tried this:

Look at the folder permissions where you are storing the data. Make sure the .NET has rights to it.

Eric

dillieo
04-29-2004, 11:13 PM
Hey Eric, thanks for the suggestion. We did check those to make sure they were all worked out. Oddly enough, the solution was that we had to remap the application to point to Framwork version 1.1 since it was pointing to version 1.0 by default. We have both versions currently on our server and I'm guessing the app was getting mixed up in the process. Go fig. 8^D