SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Postprocessing Options
boblpope
#1 Posted : Wednesday, November 25, 2009 10:30:00 AM
Rank: Newbie

Groups: Registered

Joined: 11/18/2009
Posts: 4

Does post processing happen once or once for each file uploaded?

Axosoft
#2 Posted : Friday, November 27, 2009 1:00:45 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

Post processing happens once for the upload, and not for each file. When you enable post processing, the page will leave the upload progress bar displayed as it does the postback after upload. You will get the UploadComplete event fired server side while the page is still displaying the upload progress bar. You can do your processing at that point, and update the progress bar as you're doing it. Once you complete postprocessing, the page will complete the postback. The Custom Progress sample demonstrates this.

Let me know if you have any questions on this.

boblpope
#3 Posted : Monday, November 30, 2009 5:02:23 PM
Rank: Newbie

Groups: Registered

Joined: 11/18/2009
Posts: 4

Chris,
I am having a problem where the OnUploadComplete event, which I believe identifies the post-processing method to execute if HasPostProcessStep="true"
isn't it? If I place a breakpoint at the beginning of SlickUpload1_UploadComplete it breaks after the files are uploaded, if I continue the avscan is run for each file (a console window is created for each file scanned) and then it breaks again at the beginning of the method, hitting continue re-runs the method completely. In my post processing I add each item to either a List if it completes post processing or a Dictionary with FileName and reason if the upload fails post processing. These two collection items are then databound to repeaters showing files successfully uploaded and processed and one showing files that fail processing and are deleted and the reason why. All successful uploads are listed twice in the repeater, failed uploads are crashing the process because on the second time through, the file doesn't exist on disk.  I think I can make it work with a counter to skip over the processing on the second call but that is a kludge and I'd like to avoid the unnecessary clock ticks if I can.

I can't figure out why the post processing is running twice, I have copied my control setup below if you want to take a look and see if there is anything obvious.

 <kw:SlickUpload ID="SlickUpload1" runat="server" ConfirmNavigateDuringUploadMessage="Do you really want to leave this page during upload? Your upload will stop." ShowDuringUploadElements="cancelLink" HideDuringUploadElements="fileSelectText,uploadButton" OnUploadComplete="SlickUpload1_UploadComplete" AutoUploadOnPostBack="false" HasPostProcessStep="false" OnClientBeforeUpload="DeleteOldUserDirectory">
<DownlevelSelectorTemplate>
<input type="file" />
</DownlevelSelectorTemplate>
<UplevelSelectorTemplate>
<input type="button" value="Add File" />
</UplevelSelectorTemplate>
<FileTemplate>
<kw:FileListRemoveLink ID="FileListRemoveLink1" runat="server" Title="Remove">
<img width="20" height="20" alt="Remove File" style="vertical-align: text-bottom" src="<%=ResolveUrl("~/images/close.gif") %>" />
</kw:FileListRemoveLink>
<kw:FileListFileName ID="FileListFileName1" runat="server" />
<kw:FileListValidationMessage ID="FileListValidationMessage1" runat="server" ForeColor="Red" />
</FileTemplate>
<ProgressTemplate>
<table width="99%">
<tr>
<td>Uploading <kw:UploadProgressElement runat="server" Element="FileCountText" />,
<kw:UploadProgressElement runat="server" Element="ContentLengthText">(calculating)
</kw:UploadProgressElement>.
</td>
</tr>
<tr>
<td>
Currently uploading:<kw:UploadProgressElement runat="server" Element="CurrentFileName" />,
file
<kw:UploadProgressElement runat="server" Element="CurrentFileIndex">&nbsp;
</kw:UploadProgressElement> of <kw:UploadProgressElement runat="server" Element="FileCount" />.
</td>
</tr>
<tr>
<td>
Speed:<kw:UploadProgressElement runat="server" Element="SpeedText">(calculating)
</kw:UploadProgressElement>.
</td>
</tr>
<tr>
<td>
About <kw:UploadProgressElement runat="server" Element="TimeRemainingText">(calculating)
</kw:UploadProgressElement> remaining.
</td>
</tr>
<tr>
<td>
<div style="border: 1px solid #008800; height: 1.5em; position: relative">
<kw:UploadProgressBarElement runat="server" Style="background-color: #00ee00; width: 0;
height: 1.5em"
/>
<div style="text-align: center; position: absolute; top: .15em; width: 100%">
<kw:UploadProgressElement runat="server" Element="PercentCompleteText">(calculating)
</kw:UploadProgressElement>
</div>
</div>
</td>
</tr>
</table>
</ProgressTemplate>
</kw:SlickUpload>

Axosoft
#4 Posted : Tuesday, December 01, 2009 8:40:18 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

If you turn HasPostProcessStep off, do you still get the multiple events triggered? Are you potentially wiring up the event twice? (for example, if you're using VB.NET, adding a handles statement).

Can you email your entire .aspx and codebehind to chrish at krystalware dot com so I can reproduce the issue directly?

Users browsing this topic
Guest
Forum Jump  
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.