Click here to Skip to main content
13,350,483 members (72,243 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 21:19pm
Updated 23-May-12 21:47pm
SAKryukov 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 24 May 2012
Copyright © CodeProject, 1999-2018
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