Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello all,
I have an issue whereby I am trying to create a data image but encounter an timeout issue when rendering the page.
Can someone please shed some light as the possible reasons why?
Here is my code below:
// Loop sections foreach ( var item in @node.DescendantsOrSelf("Section") ) { string image = "....path...."; byte[] array = System.IO.File.ReadAllBytes( Server.MapPath(image) ); string baseCode = Convert.ToBase64String(array); contentList.Add( string.Format( @"{{ text: ""data:image/jpeg;base64,{0}"" }}", baseCode ) ); }
Encase anyone needs help, this was my solution:
using ( MemoryStream ms = new MemoryStream() ) { var webClient = new WebClient(); string imageUrl = image; if ( type == "local" ) { imageUrl = "https://" + @HttpContext.Current.Request.Url.Host + "/" +image; } byte[] imageBytes = webClient.DownloadData(imageUrl); return Convert.ToBase64String( imageBytes ); }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Data image - ReadAllBytes TimeOut
Hello all,
I have an issue whereby I am trying to create a data image but encounter an timeout issue when rendering the page.
Can someone please shed some light as the possible reasons why?
Here is my code below:
Encase anyone needs help, this was my solution:
is working on a reply...