Have never uploaded a file / image 🙂
again, will try to explain as much as possible..
Have a MVC3 application. the user needs to have the option to Upload a Image , crop it as required and then it should be saved as byte[] in db ..
would appreciate any help for telling how to upload a image, crop it (jQuery), send it to server as byte[] and then retrieve later for viewing when user logs in ..
have looked at jCrop but am not aware of how to upload an image, and load it in the HTML file for jCrop to use.
As said, using MVC3 with Razor view engine.
EDIT:
Have used the following ViewPage code:
<form action="/home/index" method="post">
<input type="file" name="file" />
<input type="submit" value="upload" />
</form>
And the following controller Action
[HttpPost]
public ActionResult Index(HttpPostedFileBase file)
{
return View();
}
but the parameter ‘file’ is null
Thank you for the support ..
have solved the problem using System.Web.Helpers for managing image receipt at the controller and using its method to crop an image after receiving the co-ordinates from Jcrop .. Then again using a webhelper function to convert the Image to byte[] ..
thank you for the kind suggestion though ..