}
if i use this it works but when i try another way its sucks
const formData = new FormData();
Hi there,
Is it possible to pass in a function to the saveUrl attribute of the Upload component.
My use case is that I need to trigger the upload with a button but need to do some additional processing first (calling another API). The uploading of the files will depend on this other API call.
Is the only option through an Interceptor? I've seen an implementation for React (see here) and it would be great if we have the same functionality in Angular.
Is this implementation in the roadmap and if so, when can we expect this to come out?
Also, when we set the autoUpload attribute to false, it automatically shows a Clear and Upload buttons. Is there a way to hide these buttons? I know you can position them through the actionsLayout attribute. It would be nice to have a none option to hide them.
Thanks!
It is possible On herewhen i remove<kendo-upload#upload[saveField]="'file'"[saveUrl]="uploadSaveUrl"[removeUrl]="uploadRemoveUrl"[autoUpload]="false"[withCredentials]="false"(remove)="removeImg($event)"(upload)="onFileUpload($event)"(success)="onUploadSuccess($event)"(complete)="complete()"(cancel)="cancel($event)"(error)="error($event)"(focus)="focus()"(pause)="pause($event)"(uploadProgress)="uploadProgress($event)"(resume)="resume($event)"[chunkable]="chunkSettings"></kendo-upload>
this tag helps to customize the message hints, but it's coming as a string
we need to show the hint like this. How do we do?
Hi , I am using the uploader but I want to limit the number of files that the user can select , the uploader is set to manual uploading and user can select multiple files , so if the user select 7 files and the MaxFileLimit is set to 5, I want to add 5 files to the list and removed the rest .
<kendo-upload
[saveUrl]="uploadUrl"
[autoUpload]="false"
[actionsLayout]="actionsLayout"
[restrictions]="imageRestrictions"
(select)="select($event)"
(remove)="remove($event)"
(clear)="clear()"
(upload)="uploadEventHandler($event)"
(complete)="complete()">
<ng-template kendoUploadFileInfoTemplate let-file>
<div><img [src]="findPreview(file)" style="height: 50px;"> Name: {{file[0].name}} </div>
<div *ngIf="file[0].validationErrors">You cannot upload this file :: {{file[0].validationErrors[0]}}</div>
</ng-template>
</kendo-upload>
I have tried using the Select Event to remove the file using e.preventDefault(); but it does stop the process and not files are added to the list if the users select more than 5 files .
publicselect(e: SelectEvent): void {
const that = this;
e.files.forEach((file) => {
if (file.extension === '.jpg') {
if (this.imageCount < this.maxImageCount) {
this.imageCount++
if (!file.validationErrors) {
const reader = newFileReader();
reader.onload = function (ev) {
const image = {
src: ev.target["result"],
uid: file.uid,
};
that.imagePreviews.unshift(image);
};
reader.readAsDataURL(file.rawFile);
}
}else {
e.preventDefault();
}
}
});
}
Any ideas on how to remove the extra files or limit the number of files the user can select .
Thanks
Hello,
I'm using kendo-upload for uploading files and displaying progress by subscribing to the uploadProgress event.
When [chunkable]="false" it seems that the event is fired every second or less, allowing the developer to show the progress smoothly.
The above is not true when [chunkable] is set to some value, the event is fired only when every next chunk is uploaded. Consider the following settings: [chunkable] = "{ size: 1048576} and file size to upload is 10Mb, in this case, only 10 events are going to be fired with event.percentComplete = 10, 20, 30 .... 100. This prevents me from building a progress indicator that works smoothly enough. Any ideas about getting uploadProgress fired during the chunk upload more often than once at the end?
I am utilising the Kendo Uploader which is hitting a .net Frameworks api. The endpoint saves the file and then using the Telerik Doc library will open the uploaded spreadsheet and a validation begins where each row is validated against a set of rules. If any row fails to validate then details of the failure are recorded as a list. Once all rows have been checked the error list is returned as a json response. If the sheet validates without error the code will then save each row as a new record and return a json result confirming the number of records saved or if saving fails then an error as a json result.
I need to be able to process the json response on the client side via the onSuccess or onError events or some other way. Is this possible
Many Thanks
using kendoFileSelectFileTemplate,
would like to have some Angular TypeScript code run when the user clicks in the whitespace in the <li>
elements rendered by the kendo-upload control.