model view controller - Maximum size Exceeded exception while uploading mp4 file to web api in mvc -
i trying upload mp4 format file web api rest sharp.but every time gives me maximum file size exceeded exception.i put
<security> <requestfiltering> <requestlimits maxallowedcontentlength="1073741824" /> </requestfiltering> </security>
this code in web api application web config file no result. calling web api other application in use nuget restshap call web api.please me. code call web api.
var request = new restrequest("uploads", method.post); request.addfile("filename", server.mappath("/images/videoplayback.mp4"), "multipart/form-data"); request.addqueryparameter("participantsid", "2"); request.addqueryparameter("taskid", "77"); request.addqueryparameter("enteredansweroptionid", "235"); request.addqueryparameter("lat", "12.15"); request.addqueryparameter("lon", "12.56"); request.alwaysmultipartformdata = true; irestresponse response = createclient().execute(request);
also add entry or add attributes if have entry in web.config. executiontimeout in seconds , maxrequestlength in kb. example 2 hours , 1gb
<system.web> <httpruntime executiontimeout="7200" maxrequestlength="1048576" /> </system.web>
Comments
Post a Comment