FileUploader help

Aug 14, 2008 at 11:04 PM
Hi guys. I am having a wierd problem with your upload control and I am scratching my head trying to figure how to fix it. The control works fine and I'm able to upload pictures. The problem is, my FileReceived event is getting called twice for some reason, which in turn is causing the file to save twice. So if I upload, say, 3 files, i will have 6 files in my Upload directory. The page only appears to be posting back once. Does anyone know how to fix this?
Aug 15, 2008 at 5:50 AM
Hi icemanind,

Please check to see if you don't attach your handler twice to the FileReceived event, either in code behind or from the designer. Maybe you have it assigned once in the aspx page (OnFileReceived="upload_FileReceived" )
and after that in code behind (fancyUpload.FileReceived += new Upload.FileReceivedEventHandler(upload_FileReceived);)
Aug 18, 2008 at 6:14 PM

That was exactly my problem. Thank you. I had:



Sub Upload1_FileReceived(ByVal sender As Object, ByVal e As SharpPieces.Web.Controls.UploadEventArgs)  Handles Upload1.FileReceived

In addition, I had the OnFileReceived parameter of the control set to the same thing. I removed everything after, and including the Handles statement and it fixed my problem! Thank you guys for the quick response