As you know, OnClientUploadComplete triggers after a file is successfully uploaded. However, is there a technique to read a response from the server at this point?
Why would I want to do this? Suppose a file is uploaded and saved on the server side. The file could have been a new insert, or it could have overwritten an older version of itself. I'd like the server to tell the client which of these two things happened during
OnClientUploadComplete. Since OnClientUploadComplete presumably is set off only after the server has acknowledged a successful file upload, this should be possible, yeah?
I resolved this by placing a hidden HTML input control on the page. When the upload completes, I use OnUploadedComplete on the server side to update the value of this hidden control. Then in OnClientUploadComplete I read the value.
I have more or less the same situation but I open the AsynFileUpload as a user control in a separate window. This separate window gets open by clicking a button from the main page. So my question to all experts is that when the upload is completed i.e. in
this an image has been uploaded and saved on the server
1. I close the child window (in javascript uploadComplete(sender, args) event)
2. but on the main page i want to change the source of image control to this newly uploaded image.
Calvin Nguye...
Member
4 Points
48 Posts
AsyncFileUpload's OnClientUploadComplete Event - Can Return Value from Server Be Read Here?
Oct 13, 2009 06:23 PM|LINK
Hi,
As you know, OnClientUploadComplete triggers after a file is successfully uploaded. However, is there a technique to read a response from the server at this point?
Why would I want to do this? Suppose a file is uploaded and saved on the server side. The file could have been a new insert, or it could have overwritten an older version of itself. I'd like the server to tell the client which of these two things happened during OnClientUploadComplete. Since OnClientUploadComplete presumably is set off only after the server has acknowledged a successful file upload, this should be possible, yeah?
Thanks,
Calvin
Calvin Nguye...
Member
4 Points
48 Posts
Re: AsyncFileUpload's OnClientUploadComplete Event - Can Return Value from Server Be Read Here?
Oct 13, 2009 09:27 PM|LINK
I resolved this by placing a hidden HTML input control on the page. When the upload completes, I use OnUploadedComplete on the server side to update the value of this hidden control. Then in OnClientUploadComplete I read the value.
FutureGuru
Member
57 Points
82 Posts
Re: AsyncFileUpload's OnClientUploadComplete Event - Can Return Value from Server Be Read Here?
Feb 15, 2012 01:05 AM|LINK
I have more or less the same situation but I open the AsynFileUpload as a user control in a separate window. This separate window gets open by clicking a button from the main page. So my question to all experts is that when the upload is completed i.e. in this an image has been uploaded and saved on the server
1. I close the child window (in javascript uploadComplete(sender, args) event)
2. but on the main page i want to change the source of image control to this newly uploaded image.
3. I tried to do some thing like
window.parent.document.getElementById('Image1').src = './Images/StudentImages/abc.jpg';