c# - ASP.NET MVC returns corrupted file with wrong size -
i have problem - asp.net mvc returns file wrong size, therefore corrupted , cant open it. files on server , can open them, problem in returning , downloading files, also, files corrupted when downloaded, , files good. , on rare occasions, files, downloads in wrong size, gets downloaded in correct size. file sizes 500kb. code wasnt changed long time, , started return files wrong sizes. code simple:
public actionresult getfile(string filename) { var contenttype = "image/jpeg"; if (system.io.file.exists(path.combine("c:\myfilesdirectory", filename))) { return this.file(path.combine("c:\myfilesdirectory", filename), contenttype, filename); } }
what wrong ?
Comments
Post a Comment