Hello,
I am using Kendo for Asp.Net MVC. With an ImageBrowser on the Editor control, the name returned from the server (which is different from the file name uploaded) is respected, but for the FileBrowser, the returned name is ignored. How does on get this to work?
<PackageReferenceInclude="Telerik.UI.for.AspNet.Core"Version="2021.2.616"/>
@(Html.Kendo().Editor()
.Name(Model.Id)
.HtmlAttributes(new { style = "height:470px", aria_label = "editor" })
.Tools(tools => tools
.Clear()
.Bold().Italic().Underline().Strikethrough().JustifyLeft().JustifyCenter()
.JustifyRight().JustifyFull().InsertUnorderedList().InsertOrderedList().Outdent().Indent()
.CreateLink().Unlink().InsertImage()
.InsertFile()//.SubScript()//.SuperScript()//.TableEditing()
.ViewHtml().Formatting().CleanFormatting()
)
.ImageBrowser(
imageBrowser => imageBrowser
.Transport(transport =>
{
transport.Read(r => r.Url($"/api/imageupload/read?franchiseId={Model.FranchiseId}"));
transport.Create(c => c.Url("/api/imageupload/create"));
transport.Destroy(d => d.Url("/api/imageupload/destroy"));
transport.UploadUrl($"/api/imageupload/uploadurl?franchiseId={Model.FranchiseId}");
transport.ImageUrl("/api/imageupload/imageurl?file={0}");
transport.ThumbnailUrl("/api/imageupload/thumbnailurl");
}
)
.Schema(schema => schema.Model(
model => model.Fields(fields => fields
.Name(name => name.Field("Name"))
.Size(size => size.Field("Size"))
.Type(type => type.Field("EntryType"))
)
)
)
)
.FileBrowser(
fileBrowser => fileBrowser
.Transport(transport =>
{
transport.Read(r => r.Url($"/api/docupload/read?franchiseId={Model.FranchiseId}"));
transport.Create(c => c.Url("/api/docupload/create"));
transport.Destroy(d => d.Url("/api/docupload/destroy"));
transport.UploadUrl($"/api/docupload/uploadurl?franchiseId={Model.FranchiseId}");
}
)
.Schema(schema => schema.Model(
model => model.Fields(fields => fields
.Name(name => name.Field("Name"))
.Size(size => size.Field("Size"))
.Type(type => type.Field("EntryType"))
)
)
)
)
.Value(Model.Value)
)
i may have been unclear -- for the ImageBrowser, after uploading an image, the new file name returned by the server is reflected in the images displayed.
for the FileBrowser, after uploading the original file name is displayed even if the server returns a different name.
Thank you for sharing the code snippet and providing the needed details.
The pointed behavior is expected as the functionality of the FileBrowser is strongly connected with the file system.
The fastest route to getting you up and running is if you could provide a runnable, isolated, sample project where the issue is represented. Examining this project will let us replicate the issue locally and further troubleshoot it.
Looking forward to hearing back from you.
Kind Regards,
Anton Mironov
see a project that reproduces the problem here:
https://github.com/burtonrodman/telerik-filebrowser-repro
currently, the new file entry retains the file name the user uploaded no matter what the server returns.
This works as expected for image uploads with the ImageBrowser.
Hi
Thank you for preparing the sample.
However, I am afraid we don't have the practice to download archives from third-party sources. Could you create a formal Support Ticket from your account and send the sample there?
Then, we will create a new working sample and send it back to you together with the solution.