Dear Support,
I have to validate the files before uploading them and implemented your solution from your previous post
http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1008Now I dont get the FileUploaded event any more. Here is the code:
Quote:
<eo:AJAXUploader ID="AJAXUploader1" runat="server" Width="250px"
ClientSideOnProgress="uploader_progress_handler" Rows="3"
DeleteButtonText="Ausgewählte Dateien löschen" AllowedExtension=""
ProgressBarSkin="Windows_Vista" ClientSideOnLoad=""
ClientSideOnError="uploader_error_handler" onfileuploaded="On_FileUploaded"
TempFileLocation="" AutoPostBack="True">
<LayoutTemplate>
<table border="0" cellPadding="2" cellSpacing="0" style="width: 498px">
<tr>
<td width="30px">Software</td>
<td rowspan="3" colspan="2">
<asp:PlaceHolder runat="server" id="InputPlaceHolder">Input Box Place Holder
</asp:PlaceHolder>
</td>
</tr>
<tr><td width="30px">Dokumentation</td></tr>
<tr><td width="30px">Skript</td></tr>
<tr>
<td> </td>
<td colspan="2" align="right">
<asp:Button runat="server" ID="UploadButton" Text="Übertragen" Width="82px"
CssClass="styleDisplayNone" />
<input id="btnUpload" type="button" value="Einlagern" onclick="on_start_upload();" />
</td>
</tr>
<tr>
<td> </td>
<td class="style9">
<eo:ProgressBar runat="server" id="ProgressBar" ControlSkinID="Windows_Vista" />
</td>
<td rowspan="2" align="right" valign="top">
<asp:Button runat="server" ID="CancelButton" Text="Abbruch" Width="81px" />
</td>
</tr>
<tr>
<td> </td>
<td class="style9">
<asp:PlaceHolder runat="server" id="ProgressTextPlaceHolder">Progress Text Place Holder
</asp:PlaceHolder>
</td>
</tr>
</table>
</LayoutTemplate>
</eo:AJAXUploader>
(AutoPostBack is set to true, TempFileLocation is assigned within the code-behind file.)
The client side script that starts the upload is here: As you can see, I have to do another postback before the upload, because every single input box has a certain meaning and I found no other way for the server side to keep the information, what file was entered into what input box. (Using 3 different uploaders was impractible because only one at a time can upload files)
Quote:
function on_start_upload()
{
// verify files .... [omitted]
// notify original file names related to their meanings
var oFileSoftware = document.getElementById("AJAXUploader1_i_0");
var oFileDokumentation = document.getElementById("AJAXUploader1_i_1");
var oFileSkript = document.getElementById("AJAXUploader1_i_2");
var strSoftware = oFileSoftware.value;
var strDokumentation = oFileDokumentation.value;
var strSkript = oFileSkript.value;
// send message
var strMessage = "UPLOAD:SW=" + strSoftware+";DOKU="+strDokumentation+";SCRIPT="+strSkript;
eo_Callback("cbpMessage", strMessage);
// start upload
var btn = document.getElementById("AJAXUploader1_UploadButton");
btn.onclick();
}
The element "cbpMessage" is a callback panel, that parses the message strMessage, stores the assignments into Session and renders short feedback. Normally the "FileUploaded" event handler should iterate through the "PostedFiles" collection, find the temporary files and move/rename them according to their asociated meaning stored in the Session object.
Can you tell me, why "FileUploaded" is not called (no post back is done after upload)? Is there a smarter way to upload 3 files and to find out, in what input box they were entered? What is the method "upload()" at the client uploader object for? It seems that it simply does nothing..
If there is no other solution, I could post back my own "upload_finished" event via the cbpMessage panel. But in this case I dont get the temporary names of the uploaded files from AJAXUploader. Is there a way to get the GUID that the uploader uses to create the temp file names?
Thanks in advance!
Karsten