6 Answers, 1 is accepted
0
Hi Tomasz,
This can be done with query string, which you pass to the custom handler. For example:
Sample is attached.
Regards,
Hristo Valyavicharski
Telerik
This can be done with query string, which you pass to the custom handler. For example:
<
telerik:RadCloudUpload
ID
=
"RadCloudUpload1"
runat
=
"server"
ProviderType
=
"Azure"
MultipleFileSelection
=
"Automatic"
OnClientFileSelected
=
"onClientFileSelected"
HttpHandlerUrl
=
"~/UploadToCarsFolderHandler.ashx"
>
</
telerik:RadCloudUpload
>
<
script
type
=
"text/javascript"
>
function onClientFileSelected(sender, args) {
var customParam = "test";
sender._module._handlerUrl = "/UploadToCarsFolderHandler.ashx?type=rcu&customParam=" + customParam;
}
</
script
>
public
override
void
SetKeyName(
object
sender, Telerik.Web.UI.CloudUpload.SetKeyNameEventArgs e)
{
var carsFolder = HttpContext.Current.Request[
"customParam"
] +
"/"
;
e.KeyName =
string
.Format(
"{0}{1}_{2}"
, carsFolder, Guid.NewGuid(), e.OriginalFileName);
}
Sample is attached.
Regards,
Hristo Valyavicharski
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Tomasz
Top achievements
Rank 1
answered on 14 Jan 2014, 03:23 PM
But doesn't the SetKeyName method set the file name?
Let's say I have:
http://mydomain.blob.core.windows.net/mycontainer/
and now during upload I want to have such a structure created:
http://mydomain.blob.core.windows.net/mycontainer/folder_specified_by_the_user_in_text_field/original_file_name.extension
0
Hi Tomasz,
The SetKeyName method specifies both the folder path and the file name. For example:
Regards,
Hristo Valyavicharski
Telerik
The SetKeyName method specifies both the folder path and the file name. For example:
public
override
void
SetKeyName(
object
sender, Telerik.Web.UI.CloudUpload.SetKeyNameEventArgs e)
{
var carsFolder = HttpContext.Current.Request[
"customParam"
] +
"/"
;
e.KeyName =
string
.Format(
"{0}{1}"
, carsFolder, e.OriginalFileName);
}
Regards,
Hristo Valyavicharski
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Tomasz
Top achievements
Rank 1
answered on 14 Jan 2014, 04:58 PM
Great :)
0
TheLostLeaf
Top achievements
Rank 2
answered on 25 Sep 2014, 06:12 PM
Whenever I attempt this it just concatenates the container name and blob name together and puts the blob in the configured container folder in web.config. Any Ideas, using all latest Builds with VS 2013
0
Hi TheLostLeaf,
What is the the value of the
Regards,
Hristo Valyavicharski
Telerik
What is the the value of the
e.KeyName
after you change it? Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.