This question is locked. New answers and comments are not allowed.
Hi!
In order to enable our users to drag and drop files into the Silverlight RadUpload on FireFox on a Mac, I've had to set up a complicated system where the drop gets detected by javascript and the file gets transformed into a data format that I can pass up to the Silverlight control.
I then use that data to make a MemoryStream that I can create a RadUploadSelectedFile from, and add it to the CurrentSession:
After each file is added I call PrepareSelectedFilesForUpload so that the user can see the file added and know that progress is being made on the set of files they dropped.
This process is generally working great. However, sometimes the javascript fails because the file is too large. When this happens the data comes back null, so I have no data to make a MemoryStream with and no idea how large the file was. I would like to be able to add an UploadItem to the Uploader anyway, but flag it with the "Too Large" error message so the user knows what happened to the file they picked. I definitely don't want to waste any time or processor power trying to upload the non-existant file, so I need the actual upload to skip it.
I've tried making a RadUploadSelectedFile from a zero-length MemoryStream, which gave me an UploadItem (yay!). However, adding it to the "TooLargeFiles" collection didn't seem to do anything -- it didn't show an error message to the user, and it uploaded a zero-length file to my server.
Is there a way to do what I want? I'm willing to handle any function I need to to get this to happen.
Thanks for your help!
Christina
In order to enable our users to drag and drop files into the Silverlight RadUpload on FireFox on a Mac, I've had to set up a complicated system where the drop gets detected by javascript and the file gets transformed into a data format that I can pass up to the Silverlight control.
I then use that data to make a MemoryStream that I can create a RadUploadSelectedFile from, and add it to the CurrentSession:
RadUploadSelectedFile f =
new
RadUploadSelectedFile(
new
MemoryStream(data), name);
RadUploader.CurrentSession.SelectedFiles.Add(f);
After each file is added I call PrepareSelectedFilesForUpload so that the user can see the file added and know that progress is being made on the set of files they dropped.
This process is generally working great. However, sometimes the javascript fails because the file is too large. When this happens the data comes back null, so I have no data to make a MemoryStream with and no idea how large the file was. I would like to be able to add an UploadItem to the Uploader anyway, but flag it with the "Too Large" error message so the user knows what happened to the file they picked. I definitely don't want to waste any time or processor power trying to upload the non-existant file, so I need the actual upload to skip it.
I've tried making a RadUploadSelectedFile from a zero-length MemoryStream, which gave me an UploadItem (yay!). However, adding it to the "TooLargeFiles" collection didn't seem to do anything -- it didn't show an error message to the user, and it uploaded a zero-length file to my server.
Is there a way to do what I want? I'm willing to handle any function I need to to get this to happen.
Thanks for your help!
Christina