Hello, there seems to be an issue with the Open File dialog.
I set the MaxFileSize to something really big (1200000) and then call ShowDialog(). Then, in the FileOk event handler, the File property is sometimes null. I think it has to do with the size of the file being uploaded. Over 4k perhaps?
This code should explain it.
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.MaxFileSize = 1200000;
openFileDialog1.ShowDialog();
}private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
if (openFileDialog1.File == null)
MessageBox.Show("openFileDialog1.File is null, was the file over 4K???");
else
MessageBox.Show(String.Format("File successfully uploaded to {0}", openFileDialog1.FileName));
}
thanks,
Andrew