public bool Upload(Stuff picture) { FileStream fileStream = null; BinaryWriter writer = null; string filePath; try { filePath = HttpContext.Current.Server.MapPath(".") + ConfigurationManager.AppSettings["PictureUploadDirectory"] + picture.stuffName; if (picture.stuffName != string.Empty) { fileStream = File.Open(filePath, FileMode.Create); writer = new BinaryWriter(fileStream); writer.Write(picture.stuffPhoto); //error 1,2 } return true; } catch (Exception) { return false; } finally { if (fileStream != null) fileStream.Close(); if (writer != null) writer.Close(); } }
Stuff
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)