0

I am trying to upload large video files to Amazon S3 from my asp.net-MVC application. But I can not use form POST method as ASP.NET has file size restrictions.

So, I am making an AJAX call to the controller that has all the utilities and methods for uploading the files to AMAZON S3. But I need to pass the complete path of the file for server to read file from my system and this information can not be retreived from Request object as I am not posting the file.

HTML File input control only retains the file name and not the complete path of the file. So, how can I have complete path of the file being passed to the controller where it can be worked upon by Amazon uilities for uploading.

Kanav Punj
  • 21
  • 2
  • I am trying to get this FIlE Path information on Firefox – Kanav Punj Oct 31 '11 at 18:26
  • If you're posting to Amazon S3 from your application, why does file size restrictions of ASP.NET come into play? [The browser won't send the path along with the file.](http://stackoverflow.com/questions/81180/how-to-get-the-file-path-from-html-input-form-in-firefox-3) – bzlm Oct 31 '11 at 18:31

1 Answers1

0
<% using (Ajax.BeginForm("Create", "Language",
    new AjaxOptions { UpdateTargetId = "CommonArea" },
    new { enctype = "multipart/form-data" }))
{ %>

You need to include the html attribute enctype for the HTML form as multipart/form-data and also need to include the maximum limit for the uplaod file size

You are probably need to set a new limit in request-filtering feature (replacement for url-scan) in IIS7.

By running appcmd.exe with admin priviligies and setting this to see if it helps appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost the default for this is 30000000 (slightly less than 30MB) Change the value from 30000000 to your required value.

Jayprakash S T
  • 243
  • 1
  • 2
  • 7