Rank: Newbie Groups: Member
Joined: 6/25/2008 Posts: 2
|
I am currently evaluating AJAXUploader. Everything seems to work properly, however, on the page that contains the control I also have a grid that diplays the files I have uploaded to a database. After I successfully upload a file and proceed to click on the grid button that allows me to download the file, the FileUploaded event fires again in response to the other controls event handler being fired and the file gets uploaded a second time. Not sure why an event fired for a datagrid would also fire the FileUploaded event. Also, the temp files do not appear to get deleted after the upload. When I check the folder they are still there. And last if I do not want to display the delete tempfile functionality should I just remove the items from the template? Please advise.
Thanks,
Matt
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Matt,
I understand that you mentioned about several concerns:
1. The FileUploaded event is being triggered by another control; 2. The FileUploaded event is being triggered more than once; 3. Temp files do not appear to get deleted;
#1 and #3 is normal. #2 should be a minor bug but should not cause any problems.
#1 is quite normal. In fact FileUploaded event is fired by other controls most of the time. Consider the uploader as a TextBox control, user enters text and then click another button to submit the page, at which point the TextBox's Change event is fired. It's very similar for the uploader. The difference is while user types in a character in the textbox, the uploader uploads a file to the temp directory, since the files are not officially submitted yet, it sits there and wait to be officially submitted, either by the uploader itself (by setting the uploader's AutoPostBack to true), or by another control.
#3 is not an issue. Those files will eventually be deleted. The uploader cleans up these files after a delay. They do not get cleared immediately because your code may still be working on it.
#2 is a known issue, which we have already fixed in our internal builds. The FileUploaded event can be fired more than once. However inside FileUploaded event you would PostedFiles property for a list of the posted files. When FileUploaded event is fired for the first time, PostedFiles should contain the correct list. When it is fired for the second time, this list is empty. So as soon as the code is based on PostedFiles, there should not be any problem.
Hope this helps. Please let us know if you have any more questions.
Thanks
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
An additional note on #2: It has been noted that under some circumstance FileUploaded can indeed be fired more than once with PostedFiles always populated. In this case please call ClearPostedFiles inside your FileUploaded event handler after you processed the uploaded files.
|