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

Upload Manager - email confirmation Options
sam
#1 Posted : Tuesday, March 25, 2008 1:24:33 PM
Rank: Newbie

Groups: Registered

Joined: 3/25/2008
Posts: 5

Hi,

I'm very much a .net novice so any help would be appreciated...using uploadManager (and the UploadManagerVB sample project), after a successful upload I would like to automatically send an SMTP email containing a link to the uploaded file.  I've added an additional field (name="email") to enter an email address in the uploadForm form within UploadHandler.aspx.  I'm trying to get hold of this input in the uploadManager_UploadComplete sub using uploadForm.email.value but can't ('upLoad form not declared')!  Can anybody tell me where I'm going wrong - I suspect I'm way off the mark! - or suggest a better solution?

Thanks

Sam

ChrisHynes
#2 Posted : Tuesday, March 25, 2008 4:19:10 PM
Rank: Administration


Groups:

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

To access custom fields in the UploadHandler.aspx, you'll need to handle the upload from within that file instead of using the UploadComplete event -- the UploadedFile array is the only part of the request that's merged into the parent page request. To do this, add the following code to the Page_Load event of the UploadHandler.aspx file:

Dim status As UploadStatus = HttpUploadModule.GetUploadStatus()

If Not status Is Nothing Then
   ' TODO: put code from UploadComplete event here
End If

You'll also need to add the following namespace imports to the top of the codebehind:

Imports Krystalware.SlickUpload
Imports Krystalware.SlickUpload.Status

sam
#3 Posted : Wednesday, March 26, 2008 7:36:07 AM
Rank: Newbie

Groups: Registered

Joined: 3/25/2008
Posts: 5

Thanks Chris.  I've added your code and inserted the contents of the UploadComplete event where suggested.  Should I also need to copy any code ( UploadManager?) from UploadArea.ascx into the UploadHandler page?  If not, how can I declare uploadPanel, uploadResultsPanel etc. now in the UploadHandler ?

Thanks again  

ChrisHynes
#4 Posted : Thursday, March 27, 2008 7:22:35 AM
Rank: Administration


Groups:

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ
You can leave any code that manipulates the page (e.g. showing/hiding uploadPanel/uploadResultsPanel) in the UploadComplete event. That will continue to run so you can update the page display. Put just the code that needs to access other form values on the UploadHandler page.
sam
#5 Posted : Friday, March 28, 2008 2:54:14 PM
Rank: Newbie

Groups: Registered

Joined: 3/25/2008
Posts: 5

If you don't mind, can I ask one final (I hope) question on this..?  I've added RequiredFieldValidators to my TextBox's and really need them to be populated before a user is able to select a file and upload it.  However, validation doesn't seem to be working...  I'm using

<asp:Button ID="submitButton" runat="Server" Text="Send It" class="suSubmitButton" OnClientClick="SlickUpload_Submit();return false;" />

in the UploadArea.ascx with

AutoUploadOnPostBack="false"

in the UploadManager.  I'm also finding (in IE6 and Firefox 2.0) the UploadManagerRequiredFieldValidator isn't prohibiting the submitbutton from firing if no file is selected...

Thanks for any help you can offer

ChrisHynes
#6 Posted : Monday, March 31, 2008 10:02:46 PM
Rank: Administration


Groups:

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

Calling SlickUpload_Submit() directly submits the files. It assumes you have validated the form and does not trigger validation. To check validation first, call the ASP.NET client validation function before calling SlickUpload_Submit(). To do this, replace your OnClientClick statement with the following:

OnClientClick="if (Page_ClientValidate()) { SlickUpload_Submit(); } return false;"
sam
#7 Posted : Thursday, April 10, 2008 12:54:54 PM
Rank: Newbie

Groups: Registered

Joined: 3/25/2008
Posts: 5

Including the Page_ClientValidate() function still doesn't seem to validate the other inputs I have in the uploadHandler on the page - I'm still struggling with this!  Is there anything else I can try?  

ChrisHynes
#8 Posted : Tuesday, April 15, 2008 10:22:44 PM
Rank: Administration


Groups:

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ
Can you email me a copy of your page and upload handler .aspx and codebehind? chrish at krystalware dot com. I'll take a look and get back to you.
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.