Click here to Skip to main content
15,893,161 members
Home / Discussions / C#
   

C#

 
GeneralRe: Missing data on Windows App form C# Pin
Jochen Arndt7-Jun-17 3:26
professionalJochen Arndt7-Jun-17 3:26 
AnswerRe: Missing data on Windows App form C# Pin
Luc Pattyn8-Jun-17 13:44
sitebuilderLuc Pattyn8-Jun-17 13:44 
GeneralRe: Missing data on Windows App form C# Pin
Member 1313172611-Jun-17 20:41
Member 1313172611-Jun-17 20:41 
GeneralRe: Missing data on Windows App form C# Pin
Luc Pattyn12-Jun-17 6:15
sitebuilderLuc Pattyn12-Jun-17 6:15 
GeneralRe: Missing data on Windows App form C# Pin
Member 1313172612-Jun-17 20:39
Member 1313172612-Jun-17 20:39 
GeneralRe: Missing data on Windows App form C# Pin
Luc Pattyn12-Jun-17 23:42
sitebuilderLuc Pattyn12-Jun-17 23:42 
QuestionJson parser error when converting iphone images from bytes to base64 string in a MVC JsonResult Pin
jkirkerx6-Jun-17 10:22
professionaljkirkerx6-Jun-17 10:22 
AnswerRe: Json parser error when converting iphone images from bytes to base64 string in a MVC JsonResult [solved] Pin
jkirkerx6-Jun-17 12:49
professionaljkirkerx6-Jun-17 12:49 
Well I had a number of issues that just compounded the problem.

First after I posted the page back with the wrong picture data ( A picture in which I used JavaScript to capture page form data and just converted the selected image to a base64 string and stuffed it in a textbox to postback later), I used the wrong data or bytes to store the image in the database (The original and not the copy). I should of used the bytes from the new Graphic after resizing. This got rid of the iPhone data (EXIF stuff) that was in the image stream. So now my Base64 string starts with that
iVBOR
instead of
/9


After that, I searched everywhere on how to UTF8 a Base64 string and could not find anything on the subject. So I created a new JsonResult and set the max limit, content type and encoding and returned that object instead.
[HttpPost]
public async Task<JsonResult> json_load_portfolio_picture(int PictureID, string PictureName)
{
   model_portfolio_image picture = io_portfolio_images.Load_Portfolio_Picture(PictureID);
   if (picture != null)<br />
      picture.Base64 =  Convert.ToBase64String(picture.Data, Base64FormattingOptions.None).Trim();            

         JsonResult jResult = new JsonResult()
         {
            Data = picture,
            JsonRequestBehavior = JsonRequestBehavior.AllowGet,
            ContentEncoding = Encoding.UTF8,
            MaxJsonLength = 50000000,
            ContentType = "application/json"
         };

         await Task.Delay(1);
         return jResult;
  }
If it ain't broke don't fix it

SuggestionRe: Json parser error when converting iphone images from bytes to base64 string in a MVC JsonResult [solved] Pin
Richard Deeming7-Jun-17 0:57
mveRichard Deeming7-Jun-17 0:57 
GeneralRe: Json parser error when converting iphone images from bytes to base64 string in a MVC JsonResult [solved] Pin
jkirkerx7-Jun-17 6:33
professionaljkirkerx7-Jun-17 6:33 
QuestionCreate a chart in PowerPoint using C#. Pin
Member 126813284-Jun-17 22:30
Member 126813284-Jun-17 22:30 
AnswerRe: Create a chart in PowerPoint using C#. Pin
OriginalGriff4-Jun-17 22:43
mveOriginalGriff4-Jun-17 22:43 
Questioncustom controls not binding wpf Pin
Member 112967764-Jun-17 7:52
Member 112967764-Jun-17 7:52 
AnswerRe: custom controls not binding wpf Pin
Gerry Schmitz5-Jun-17 5:36
mveGerry Schmitz5-Jun-17 5:36 
GeneralRe: custom controls not binding wpf Pin
Member 112967765-Jun-17 18:30
Member 112967765-Jun-17 18:30 
QuestionConfigure Remote Machine's IP in C# Service At Install Time Pin
Django_Untaken3-Jun-17 22:58
Django_Untaken3-Jun-17 22:58 
AnswerRe: Configure Remote Machine's IP in C# Service At Install Time Pin
Eddy Vluggen4-Jun-17 2:55
professionalEddy Vluggen4-Jun-17 2:55 
AnswerRe: Configure Remote Machine's IP in C# Service At Install Time Pin
Gerry Schmitz4-Jun-17 4:45
mveGerry Schmitz4-Jun-17 4:45 
QuestionReport cant be display on report viewer page in c#.net windows form Pin
Member 132383512-Jun-17 22:31
Member 132383512-Jun-17 22:31 
AnswerRe: Report cant be display on report viewer page in c#.net windows form Pin
User 41802543-Jun-17 3:32
User 41802543-Jun-17 3:32 
QuestionHow to solve 2 js script file crash problem Pin
Member 130563031-Jun-17 16:22
Member 130563031-Jun-17 16:22 
AnswerRe: How to solve 2 js script file crash problem PinPopular
Gerry Schmitz1-Jun-17 16:47
mveGerry Schmitz1-Jun-17 16:47 
GeneralRe: How to solve 2 js script file crash problem Pin
OriginalGriff1-Jun-17 20:25
mveOriginalGriff1-Jun-17 20:25 
AnswerRe: How to solve 2 js script file crash problem Pin
Pete O'Hanlon1-Jun-17 21:49
mvePete O'Hanlon1-Jun-17 21:49 
Questiondatagrid view to pdf by iTextsharp Pin
Member 130230281-Jun-17 9:07
Member 130230281-Jun-17 9:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.