This project has moved. For the latest updates, please go here.

Upload to database using the Upload handler

Jun 14, 2009 at 6:04 AM

Are there ways to uploads to a database or use server code to access file name and parameters using the Upload Handler? Any help will be very much appreciated. And can I restric t upload to just one file, I set MaxUploads=1 but that does not seem to do it

Coordinator
Jun 14, 2009 at 10:13 AM

It's a multi file uploader, you can always upload multiple files :)

Setting the MaxUploads to 1 means it will only upload one at a time.

Use this method in the HttpUploader for server side processing after the upload is finished:

protected virtual void FinishedFileUpload(string fileName, string parameters)
    {
    }

Jun 14, 2009 at 4:40 PM

Thank you for your prompt response, I have a follow up. This might be a an Asp.net thing but I am using a modal popup for the upload i.e. put the silverlight control on a modal popup. Once upload is completed I want to pass certain values to the parent form (file name and other parameter. I have to capute more data from tha parent form and then save to the database.  popup works and all but I can't seem to get access to some parameters from like the file name etc. I want to do the sever processing on the parent aspx form.

Any help will be appreciated.

Coordinator
Jun 14, 2009 at 4:45 PM

That's an unsupported scenario, my advice is not to do it that way.

Put all your server side processing in the HttpHandler. That way it is really part of the upload process. When the Multi File Uploader indicates an upload it finished, it also means your custom server side processing is finished. So you can then continue to do whatever you want with the uploaded files.

Jun 14, 2009 at 5:02 PM
Edited Jun 15, 2009 at 1:49 AM

 

I implemented IRequiresSessionState interface and was able to save info in session on upload complete and use them later, I would however love to be able to show just the upload progress, i.e windowless. I tried the windowless=true property and that did not do it.