File or directory not found error while uploading file

0 Answers 91 Views
Upload
cirilla
Top achievements
Rank 1
cirilla asked on 23 Dec 2021, 02:21 PM

Greetings. I am getting the following error while uploading a file with Kendo upload. Code works fine at local. But it gives this error on the server.

Error:

 

Client-Side Code:

             

 $("#batchFile").kendoUpload({
                   async: {
                       saveUrl: '/DijitalArsiv/UploadFile/',
                       autoUpload: false
                   },
                upload: function (e) {


                    if (uploadFileNode.isMainFolder) {
                        realPath = realPath + "\\" + personelID
                    }

                    e.data = { "id": uploadFileNode.id, "path": realPath, "isMainFolder": uploadFileNode.isMainFolder, "type": uploadFileNode.spriteCssClass };


                   },
                   select: function (e) {

                       if (e.files.length != 0) {
                           $.each(e.files,function (index, value) {

                               var filtredValue =  acceptedFileTypes.filter(x => x == value.extension)
                               if (filtredValue.length == 0) {
                                   e.preventDefault();
                                   $("#message-alert").html("Sadece '.pdf', '.jpg', '.png', '.jpeg', '.docx', '.xlsx'  türünde dosyalar yükelenebilir. Lütfen yüklediğiniz dosyların türünü kontrol edin.")
                                    kendoWindowMessageAlertModal.data("kendoWindow").content($("#message-alert").html()).center().open();
                               }
                           })
                       }
                   },
                   success: function (e) {

                       if (e.response.Status) {
                           getTreeView().append([{ id: e.response.ID, text: e.response.FileName, spriteCssClass: e.response.Type, UnicParentCode: nodeToUploadParent.UnicParentCode, isDraggable: true, isDroppable: true, hasChildren: false, isEditable: false, isMainFolder: false }], nodeToUpload)
                           updateBackupTree();
                       } else {
                           e.preventDefault();
                       }
                   },
                   multiple: true,
                   batch: true,
                   localization: {
                        cancel: "İptal",
                        dropFilesHere: "Dosyalarınızı Buraya Sürükleyebilirsiniz!",
                        remove: "Sil",
                        retry: "Tekrar Dene!",
                        select: "Dosya Seç",
                        statusFailed: "Yükleme Başarısız!",
                        statusUploaded: "Yükleme Başarılı!",
                        statusUploading: "Yükleniyor...",
                        uploadSelectedFiles: "Yükle"
                   }
               });

Server-side Code:

        [HttpPost]
        public JsonResult UploadFile(HttpPostedFileBase batchFile, int? id, string path, bool isMainFolder,string type)
        {

        }

 

 

Ianko
Telerik team
commented on 29 Dec 2021, 08:20 AM

Hi, 

The exception you get alerts you that the setup endpoint (the controller's action) does not exist and IIS cannot reach it. If that works locally and not in production or remote you should examine why the endpoint is not valid for the published application. 

Note that with MVC it would be better to use the @Url.Action helper so that you have the URL generated based on the hosted application.

cirilla
Top achievements
Rank 1
commented on 29 Dec 2021, 11:30 AM

I am using multiple ajax requests with kendo on the same page. I just have a problem with kendo upload. I'll go over what you said. But I don't think there is a problem with the endpoint. Because I had this problem only on upload.
cirilla
Top achievements
Rank 1
commented on 29 Dec 2021, 12:12 PM

Can we at least specify a parameter as "post" or "get" while uploading? Or does it automatically "post"?
cirilla
Top achievements
Rank 1
commented on 29 Dec 2021, 12:25 PM

Or do I need to add something related to that in the web config?

cirilla
Top achievements
Rank 1
commented on 29 Dec 2021, 02:39 PM

Ok i got it. The problem is not with you. thanks for everything.

No answers yet. Maybe you can help?

Tags
Upload
Asked by
cirilla
Top achievements
Rank 1
Share this question
or