|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
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.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
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?
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
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
|
|