This is a migrated thread and some comments may be shown as answers.

Safari issue with chunks

7 Answers 222 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Synapse
Top achievements
Rank 1
Synapse asked on 17 Jun 2017, 08:34 PM

Hi,

I am using http://demos.telerik.com/aspnet-mvc/upload/chunkupload to upload video file around 2 GB using chunk of 10 MB, all setting in config has been done.

It worked on Firefox, Chrome and IE with no issue, great tool.

But when I tried to upload using safari on windows 10 OS, the same code do not worked and it seems it is in infinite loop and file size keeps increasing...

Config setting is as below:

 <httpRuntime targetFramework="4.5" maxRequestLength="2147483647"/>

<security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483647"/>
      </requestFiltering>
 </security>

.cshtml:

@(Html.Kendo().Upload()
    .Name("files")
    .Async(a => a
        .Save("ChunkSave", "Upload")
        .Remove("Remove", "Upload")
        .AutoUpload(true)
        .ChunkSize(20000000) // Will separate the file into chunks of size 1100 bytes.
        .Concurrent(true) // Will upload all files simultaneously.
        .AutoRetryAfter(300) // Will attempt a failed chunk upload after 300ms.
        .MaxAutoRetries(4) // Will attempt the same failed chunk upload 4 times.
    )
)

C# code:
  public void AppendToFile(string fullPath, Stream content)
        {
            try
            {
                using (FileStream stream = new FileStream(fullPath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
                {
                    using (content)
                    {
                        content.CopyTo(stream);
                    }
                }
            }
            catch (IOException ex)
            {
                throw ex;
            }
        }

        public ActionResult ChunkSave(IEnumerable<HttpPostedFileBase> files, string metaData)
        {
            if (metaData == null)
            {
                return Save(files);
            }

            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(metaData));
            var serializer = new DataContractJsonSerializer(typeof(ChunkMetaData));
            ChunkMetaData chunkData = serializer.ReadObject(ms) as ChunkMetaData;
            string path = String.Empty;
            // The Name of the Upload component is "files"
            if (files != null)
            {
                foreach (var file in files)
                {
                    path = Path.Combine(Server.MapPath("~/App_Data"), chunkData.FileName);

                    AppendToFile(path, file.InputStream);
                }
            }

            FileResult fileBlob = new FileResult();
            fileBlob.uploaded = chunkData.TotalChunks - 1 <= chunkData.ChunkIndex;
            fileBlob.fileUid = chunkData.UploadUid;

            return Json(fileBlob);
        }


        public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments)
        {
            //The Name of the Upload component is "attachments".
            foreach (var file in attachments)
            {
                //Some browsers send file names with a full path. You only care about the file name.
                var fileName = Path.GetFileName(file.FileName);
                var destinationPath = Path.Combine(Server.MapPath("~/App_Data"), fileName);

                file.SaveAs(destinationPath);
            }

            //Return an empty string to signify success.
            return Content("");
        }

Can any one help me if I did something wrong?

7 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 20 Jun 2017, 02:08 PM
Hello Synapse,

I am glad to see that you are happy with our product.

As for your question - I am afraid that Apple dropped Safari support on Windows for several years now, which is the reason why we don't support this combinatino as well. In our documentatino you can revise all supported browser and operational systems:

http://docs.telerik.com/kendo-ui/intro/supporting/browser-support#operating-system-support

(note the support for Safari - OS X)

Please let me know, should you have any further questions.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Synapse
Top achievements
Rank 1
answered on 21 Jun 2017, 07:23 PM

Hi Nencho,

Thanks for your response.

I am facing another issue with chunking, after merging of video some of the videos are getting corrupted.

Once chunks are uploaded videos are uploaded and merged I am using an other third party tool "ffmpeg" to create thumbs and video preview, this tool throws error that video is corrupted. When I upload original video using FTP, "ffmpeg" creates thumbs and video preview.

can you help me on this? merging process is same as explained above.

Regards,

Synapse India.

0
Nencho
Telerik team
answered on 23 Jun 2017, 12:58 PM
Hello Synapse,

I am afraid that we are not aware of the referenced third part tool that you mentioned and such is not supported. However, I would suggest you to submit a support ticket, along with a runnable sample attached, so we could revise the implementation and the experienced issue and eventually pin down the reason for it.

In addition, do you observe any changes with the file, once it is upload? For example does its size changed, once the file is uploaded or any similar issues with it?

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Synapse
Top achievements
Rank 1
answered on 11 Jul 2017, 02:08 PM

Hi Nencho,

User are getting issue while upload on Mac Safari.

I tried on Mac safari 10.0.3, it  worked but on Mac Safri with version 10.1.1 (12603.2.4), it can not be uploaded and says retry...

User is trying to upload 1-2 GB files.

Please suggest.

0
Nencho
Telerik team
answered on 13 Jul 2017, 08:08 AM
Hello Synapse,

I tried to replicate the described issue on Safari 10.1.1 using our online demos, but it seems that there is not issue in uploading the file:

https://www.screencast.com/t/vtaIp7c0R3


Could you please provide us with a runnable example, demonstrating the issue, so we could locally test it and try to pin down the reason for it.

Lastly, please check the dev tool console for any javascript errors?

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Synapse
Top achievements
Rank 1
answered on 14 Jul 2017, 07:01 AM

Hi Nencho,

Thanks for your response.

Earlier we tried 2 GB file it didn't worked but next day same thing worked.

I am not sure what happened on that particular day.

I will be back to you if I can re-produce it again.

Thanks,

Saurabh

 

 

0
Nencho
Telerik team
answered on 14 Jul 2017, 12:13 PM
Hello Synapse,

Yes, of course. Feel free to get back to us if the issue replicates again. In addition, it would be best if you could directly submit a support ticket, along with a runnable sample attached, where we can observe the problem and pin down the eventual reason for it.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Upload
Asked by
Synapse
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Synapse
Top achievements
Rank 1
Share this question
or