Axosoft Support Forums
»
SlickUpload
»
SlickUpload Support
»
get server filename in OnClientUploadFileEnded function
|
|
Rank: Newbie
Groups: Registered
Joined: 3/23/2007 Posts: 9
|
Hello:
I am using the slick mvc3 sample project as my base. I've added a custom filename generator and code to resize the image. I'd like to show the user a thumbnail of the image after the upload but can't find the filename that the custom filename generator used. Is it possible to get this information in the OnClientUploadFileEnded javascript function?
Thanks,
|
|
|
Rank: Administration

Groups: Administrators
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
You can set data in the UploadStreamProvider via the file.Data dictionary, like this:
file.Data["thumbUrl"] = "somevalue";
Then, in the OnClientUploadFileEnded function, you can retrieve the value like this:
function onFileUploadEnded(file)
{
var status = file.get_Status();
if (status.errorType == "None")
{
var thumb = file.getElementById("thumb");
thumb.src = status.thumbUrl;
thumb.style.display = "block";
}
else
{
// TODO: probably an invalid image -- handle the error
alert("Invalid image!");
kw("<%=slickUpload.ClientID %>").remove_File(file);
}
}
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/23/2007 Posts: 9
|
Thanks, Chris. That was exactly what I needed.
|
|
|
|
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.