|
Rank: Newbie Groups: Member
Joined: 1/4/2008 Posts: 2
|
Hi there,
We've adopted the AjaxUpload control for our site (Approver.com) and it's working well with one exception. Every so often when a user uploads a file, the the PostedFiles collection is empty.
It seems like, by definition, there must be something in the AjaxUploader.PostedFiles collection when you're in the FileUploaded event handler. But every so often we find that PostedFiles has nothing there.
This is a very difficult problem to reproduce, but we've seen it happen in production and just now on a development machine. Refreshing the page and re-trying the upload again nearly always solves the problem.
Do you have any idea why this might be happening or whether there's something we're doing to cause it?
Thanks,
Jeffrey
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Jeffrey,
That can hapen when the user has uploaded a file, then deleted it, then postback the page. In that case FileUploaded will be fired but PostedFiles collection would be empty.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 1/4/2008 Posts: 2
|
I'm pretty sure that's not what's going on here. We have changed the default template to prevent the user from seeing the interface that enables them to delete the file -- our users can only upload one file at a time and we don't let them delete the file through the EO control after they've uploaded it.
Is there another way for this to happen?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Jeffrey,
FileUploaded event is triggered by any update action, where PostedFiles are directly related to the physical files in TempFileLocation. As soon as user has uploaded files, FileUploaded will be triggered --- that's why it can happen even if later user has deleted the file. So any situation that can trigger an empty PostedFiles has to do with the physical files in TempFileLocation being removed/can not be accessed.
If your TempFileLocation is on a network drive, then this can happen if the network had a short glitch or something the moment you try to access PostedFiles. Another situation is, if the user has uploaded a file but didn't submit the page for a while, uploader will automatically delete the server side temporary file because it assumes that session has been abandomed by the user. When that occurs, you will also get an empty PostedFiles. A third scenario is if you have some code that periodically cleans up TempFileLocation (which is not necessary), that can trigger the problem as well.
Thanks
|
|