OpenStream() yeilds a stream that cannot be closed after writing

Last post 04-18-2008, 11:44 AM by stuartwachsberg. 1 replies.
Sort Posts: Previous Next
  •  04-18-2008, 6:08 AM 39464

    OpenStream() yeilds a stream that cannot be closed after writing

    The following  code creates a hold on the temporary file on disk, even though I close the stream. The only way to continue to use the component is to shut down the aspnet_wp.exe to free the hold on the temporary file.

    protected
    void Uploader1_FileUploaded(object sender, CuteWebUI.UploaderEventArgs args)

    { byte[] imageBits = new byte[args.FileSize];

    Stream ms = args.OpenStream();

    // removing this statement makes the problem go away
    ms.Write(imageBits, 0, imageBits.Length);
     
    ms.Close();

    }
     
     
  •  04-18-2008, 11:44 AM 39482 in reply to 39464

    Re: OpenStream() yeilds a stream that cannot be closed after writing

    Ignore previous post please. I was writing to the stream.
View as RSS news feed in XML