|
|
Rank: Newbie
Groups: Registered
Joined: 5/6/2008 Posts: 6
|
Does anyone have a working example of SlickUpload used with a SQL Server, including data table definition? I am not having any luck setting this up at all.
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Are you trying to use SQL Server to store files? Or to support uploading with progress on a clustered/webfarm environment?
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/6/2008 Posts: 6
|
I am uploading to a SQL Server 2005. Right now my problem is thatI get the upload window, submit files and the progress panel gets stuck on calculating. Don't know where to go from here.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/6/2008 Posts: 6
|
I got the progressbar issue fixed. Now I am having problems finding out how to identify the records when the upload is complete. Whe there is an uploadID, why in the world is that not written to the SQL table? How do you identify the FileID's upon completion of the download?
Please help! Issues with the SlickUpload is holding an entire project back right now.
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Index into the file's LocationInfo dictionary like so:
string criteria = file.LocationInfo[SqlClientUploadStreamProvider.WhereCriteriaKey];
That will return the where clause used for the record. If you're using the Identity criteria method, you can pull out just the identity ID created like so:
string id = file.LocationInfo[SqlClientUploadStreamProvider.IdentityIdKey];
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/6/2008 Posts: 6
|
I must be completely missing something. Where do you insert those statements?
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
You're using the UploadManager control, right? Add the statements inside the UploadComplete event. You should call e.Status.GetUploadedFiles() to get a list of files (UploadedFile instances) that were uploaded. Then for each UploadedFile (the file reference above), you can call that snippet to get the id.
For example:
protected void uploadManager_UploadComplete(object sender, UploadStatusEventArgs e) { foreach (UploadedFile file in e.Status.GetUploadedFiles()) { string id = file.LocationInfo[SqlClientUploadStreamProvider.IdentityIdKey];
// do something with the id } }
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/6/2008 Posts: 6
|
Protected Sub uploadManager_UploadComplete(ByVal sender As Object, ByVal e As Krystalware.SlickUpload.Controls.UploadStatusEventArgs) Handles UploadManager.UploadComplete
uploadPanel.Visible = False
Dim Status As UploadStatus = e.Status
If e.Status.Reason = UploadTerminationReason.NotTerminated Then
For Each File As Object In Status.GetUploadedFiles()
MsgBox(File.Locationinfo(???????)) <---------WHAT GOES HERE? SqlClientUploadStreamProvider is not declared.
Next
resultsMessage.InnerText = "Upload was successful. You may close this window now."
Else
If e.Status.Reason = UploadTerminationReason.Disconnected Then
resultsMessage.InnerText = "Upload was cancelled."
Else
resultsMessage.InnerHtml = "Upload resulted in an error.<br />Reason:" + e.Status.Reason.ToString() + "<br />Message:" + _
e.Status.ErrorMessage
End If
resultsMessage.Style( "color") = "red"
End If
End Sub
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Change the for loop to read:
For Each file As UploadedFile In Status.GetUploadedFiles() Dim id As String = file.LocationInfo(SqlClientUploadStreamProvider.IdentityIdKey) Next file
Then add the following import statements to the top of the file:
Imports Krystalware.SlickUpload Imports Krystalware.SlickUpload.Status Imports Krystalware.SlickUpload.Providers
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/6/2008 Posts: 6
|
The first one was missing. Thanks!
|
|
|
|
Guest |