51466

Inserting image over 3mb via linq-to-sql

Question:

New day, new problem :-)

Code:<br /> Client Side:

void abw_Closed(object sender, EventArgs e) { DbServiceClient sc = new DbServiceClient(); abw = (AddBlobWindow)sender; fi = ((AddBlobWindow)sender).fi; if ((bool)((AddBlobWindow)sender).DialogResult) { blob = new Blob(); binBlob = new Binary(); binaryBlob = new byte[fi.Length]; int n = fi.OpenRead().Read(binaryBlob,0,Convert.ToInt32(fi.Length)); binBlob.Bytes = binaryBlob; blob.Content = binBlob; blob.Signature = abw.tbSignature.Text; blob.Size = (int)fi.Length; sc.SaveBlobCompleted += new EventHandler<AsyncCompletedEventArgs>(sc_SaveBlobCompleted); sc.SaveBlobAsync(blob); } }

Server side service code:

[OperationContract] public void SaveBlob(Blob blob) { try { RichTekstModelDataContext dc = new RichTekstModelDataContext(); dc.Blobs.InsertOnSubmit(blob); dc.SubmitChanges(); } catch (Exception ex) { string s = ex.Message; } }

The problem: When I am trying to save blobs with Content field smaller than 3mb it works perfectly, but when blob exceedes 3 mb, I am getting "Not found" exception (---> error line) in Refernece.cs file

public void EndSaveBlob(System.IAsyncResult result) { object[] _args = new object[0];

----> base.EndInvoke("SaveBlob", _args, result); }

I have no idea how to fix it. I have set in web.config apropriate buffers sizes, but stil it doesn't work.

Thanks for help.

Answer1:

OK. I have found a solution:

link to solution:

<a href="http://silverlight.net/forums/p/18162/61547.aspx" rel="nofollow">http://silverlight.net/forums/p/18162/61547.aspx</a>

Recommend

  • Powershell v2.0 Using multiple threads
  • Unzipping a file error
  • Zipping Files and Downloading them Using SaveAs Dialog
  • Outlook Com not registered
  • With one EDMX file use multiple connection strings that relate to multiple databases
  • Using Paypal Pro in Omnipay
  • HttpRequestMessage Content Disposition null when unit testing
  • jBCrypt 0.3 C# Port (BCrypt.net)
  • make EF map byte array to binary instead of varbinary
  • Send the string to its hex equivalent
  • How to handle empty space in url when downloading image from web?
  • Xamarin PCLCrypto SHA256 give different hash
  • Selecting a subset of data in ServiceStack.OrmLite
  • How to use animated gif in Firemonkey?
  • Rodeo UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal
  • Getting NullPointer exception with File.listfiles()
  • Extract zip entries to another Zip file
  • Convert Type Decimal to Hex (string) in .NET 3.5
  • copying resource to sdcard gives a damaged file in android
  • Change multiple background-images with jQuery
  • Android screen density dpi vs ppi
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • MySQL WHERE-condition in procedure ignored
  • Change an a tag attribute in JavaScript based on screen width
  • How do you troubleshoot character encoding problems?
  • Web-crawler for facebook in python
  • Rearranging Cells in UITableView Bug & Saving Changes
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • SQL merge duplicate rows and join values that are different
  • trying to dynamically update Highchart column chart but series undefined
  • Load html files in TinyMce
  • Free memory of cv::Mat loaded using FileStorage API
  • How get height of the a view with gone visibility and height defined as wrap_content in xml?
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • LevelDB C iterator
  • Can't mass-assign protected attributes when import data from csv file
  • Sorting a 2D array using the second column C++
  • java string with new operator and a literal