What are the ways to render the input value filename and send it to a controller :
<div id="fileuploaddiv" class="fileuploaddivclass">
<form action="@Model.FormAction" method="@Model.FormMethod"
enctype="@Model.FormEnclosureType">
<input type="hidden" name="key" value="uploads/${filename}" id="filename" />
<input type="hidden" name="AWSAccessKeyId" value="@Model.AWSAccessKey" />
<input type="hidden" name="Content-Type" value="image/jpeg">
<div>
Please specify a file, or a set of files:
<input type="file" name="file" />
</div>
<input type="submit" value="Upload" />
</form>
</div>
You need to look up some MVC3 conventions (I’d recommend NerdDinner as a good starting tutorial), but here is a somewhat similar approach to what you want to do:
Your model would look like (And I’m confused here because you seem to be dynamically setting the controller and action, which is unusual):
Now on to controllers:
Note: I am garbage at syntax, so you’ll have to check this, but Visual Studio should tell you what works.