T
tjonsek
I get a generic error (not very helpful) when attempting to save a
re-sized image back to its original location. Here is the code snippet:
Dim g As System.Drawing.Image =
System.Drawing.Image.FromFile(Me.File1.Value)
Dim thisFormat = g.RawFormat
Dim imgOutput As New Bitmap(g, 800, 600)
Dim strFileType As String
Dim strFileName As String = File1.PostedFile.FileName
' only the attched file name not its path
Dim c As String = System.IO.Path.GetFileName(strFileName)
imgOutput.Save(strFileName)
The last line seems to throw the error. With a hard coded path, I don't
get an error so I think somehow I am missing something. The only
difference is the missing ("") around the strFileName vs. a hard coded
path.
Any ideas?
Thank you and I appreciate your help.
re-sized image back to its original location. Here is the code snippet:
Dim g As System.Drawing.Image =
System.Drawing.Image.FromFile(Me.File1.Value)
Dim thisFormat = g.RawFormat
Dim imgOutput As New Bitmap(g, 800, 600)
Dim strFileType As String
Dim strFileName As String = File1.PostedFile.FileName
' only the attched file name not its path
Dim c As String = System.IO.Path.GetFileName(strFileName)
imgOutput.Save(strFileName)
The last line seems to throw the error. With a hard coded path, I don't
get an error so I think somehow I am missing something. The only
difference is the missing ("") around the strFileName vs. a hard coded
path.
Any ideas?
Thank you and I appreciate your help.