Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader - FileUploaded Event Options
Michael Earley
Posted: Saturday, June 16, 2007 2:29:02 AM
Rank: Newbie
Groups: Member

Joined: 6/16/2007
Posts: 8
I am using the Ajax Uploader component to upload files and want to move and rename the temporary file. I would like to use the FileUploaded event to do this but the temporary file is still being accessed by the fileuploader. Is there a way around this without having to add another button/function?

Michael
eo_support
Posted: Saturday, June 16, 2007 6:27:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Michael,

If that is the case, then it is definitely a bug. We will look into it and get back to you as soon as possible.

Thanks for reporting the issue.
eo_support
Posted: Saturday, June 16, 2007 8:48:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Mike,

We try the following code and it works fine here:

Code: HTML/ASPX
<eo:AJAXUploader runat="server" 
    id="Uploader1" TempFileLocation="~/upload_test" AutoPostBack="True">
</eo:AJAXUploader>


Code: C#
private void Uploader1_FileUploaded(object sender, System.EventArgs e)
{
    foreach (AJAXPostedFile file in Uploader1.PostedFiles)
    {
        System.IO.File.Delete(file.TempFileName);
    }
}


Can you try the same code and see if it works for you?
Michael Earley
Posted: Monday, June 18, 2007 4:36:08 AM
Rank: Newbie
Groups: Member

Joined: 6/16/2007
Posts: 8
It is working now that AutoPostaBack="True". It would be cleaner if the postback could be avoided, but this will suit my purpose.
Thanks for the prompt reply.
Michael
eo_support
Posted: Monday, June 18, 2007 5:46:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Michael,

Whether AutoPostBack is true actually does not matter, without AutoPostBack, you would use a separate button or something to postback. AJAXUploader does not postback when upload starts, but once the upload is done, it has to postback at some point so that your server side code can have a chance to run and do something with the uploaded file.

You can use a Callback to avoid full page refresh. You can see how it works in our sample. Our sample project uses them this way.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.