I have the following situation:
A homemade upload-window that contains a RadUpload control (for uploading videofiles) and some textboxes for entering meta-data about the files.
Now I have the following usage-scenarion:
-----------------------------------------
- User opens window
- User uses RadUpload to select "Video1.mpg"
- User presses RadUpload's upload button and "Video1.mpg" is uploaded to the server
- User enters meta-data for the file (Description, Category-tags)...
- Users presses "Upload meta-data"
- Program constructs XML-object in memory. This object contains the meta-data
- Program uploads the content of this XML-object to the server where it is stored as a file ("Video1.mpg.metadata") in the same folder as the file "Video1.mpg"
Is there an elegant way to do this using RadUpload? For each video-file that was (successfully) uploaded, I need to programmatically start another upload (SEPARATE from the upload that handles the video-file!!!) that uploads the contents of an XML-object to a file on the server.
Does anyone have an example of this?
I figured I could use the following code:
---------------------------
metaFileUploader.CurrentSession.SelectedFiles.Add(new RaduploadSelectedFile(xxx));
metaFileUploader.StartUpload();
--------------------------
The problem is that the constructor for RaduploadSelectedFile only takes a FileInfo object (Which in turn only takes a string pointing to a file). So there is no way to get the data from memory.
I have also read an article on here that stated how to upload a bytestream by handling the FileUploadStarting event and initializing the NewFileStream property (of the FileUploadStartingEventArgs) with a custom stream.
I don't think this is a solution because there is no FileUploadStarting event happening that I can react to because I have to add the files from memory and then start the upload.
I have a feeling that both of these suggestions could offer part of the solution, but I can't put it all together.
Kind Regards,
Neal