Click here to Skip to main content
11,565,672 members (50,818 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET MySQL MVC3
Helo Freinds

I had a doubt in what is passing from view to controller
In my controller i give like this
public ActionResult Details(byte[] data)
           Image g = new Image();
           g.Img = data;
               return View();
           var str = new { st = "saved" };
           return Json(str, JsonRequestBehavior.AllowGet);
In my view define <input type="file" id="photos">
by using file id am passing data.So in what format the controller received that data

My view file looks like this:
 $("#save").click(function (event) {
                   type: "POST",
                   url: '/Home/Details',
                   data: $('#photos').load(url),
                   contentType: "application/json; charset=utf-8",
                   dataType: "json",
                   success: function (str) {

by using this syntax data:$('#photos').load(url) so in data what is there i mean path or file.In my database fields are Id(int), img(LongBlob) so my code is not working please help provide me any suggestions or code to find out the solution....
Posted 23-May-12 20:19pm
Edited 23-May-12 20:47pm
SAKryukov at 24-May-12 2:53am
What happened? Several questions on the same topic? Whole course at some school getting identical assignments? If so, are you going to pay your money for such school? Would be sad...

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 24 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100