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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -