Hi, I am using upload and the gridbinary column pretty much right out of the samples found elsewhere on this site. I am not even bothering with upload progress bars, etc. and there is no ajax involved. I am using Q3 2009, and the Uploaded file name is present, but the length is zero - I am trying to read into a byte array but there is nothing to read into. Here is a code frag - if anyone knows what I am doing wrong here, please let me know.
Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim upload As RadUpload = DirectCast(editItem.EditManager.GetColumnEditor("Upload"), GridBinaryImageColumnEditor).RadUploadControl
Dim MyUploadedFile As Telerik.Web.UI.UploadedFile = upload.UploadedFiles(0)
Dim MyFileName As String = MyUploadedFile.FileName ' this evaluates to the file I am uploading
Dim fs As System.IO.Stream = MyUploadedFile.InputStream ' fs.length is always zero.
Dim picture As Byte() = New Byte(fs.Length - 1) {}
fs.Read(picture, 0, fs.Length - 1)
fs.Close()
Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim upload As RadUpload = DirectCast(editItem.EditManager.GetColumnEditor("Upload"), GridBinaryImageColumnEditor).RadUploadControl
Dim MyUploadedFile As Telerik.Web.UI.UploadedFile = upload.UploadedFiles(0)
Dim MyFileName As String = MyUploadedFile.FileName ' this evaluates to the file I am uploading
Dim fs As System.IO.Stream = MyUploadedFile.InputStream ' fs.length is always zero.
Dim picture As Byte() = New Byte(fs.Length - 1) {}
fs.Read(picture, 0, fs.Length - 1)
fs.Close()