Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET ClickOnce
I have array of bytes for an image that i want to send it using query string
First I convert the bytes to string using :
             MemoryStream ms = new MemoryStream();
            Image img = Image.FromFile(@"C:\Hydrangeas.jpg");
            img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
 
then send ms.ToArray() in query string but the problem is that the query string is too long and it doesn't work !!!
 
By the way it's sending to click-once application using URL.
 
Is there a way to minify the sent string
OR
is there a another way to send array of bytes using querystring
 
Any one can help ?
Posted 2-Apr-13 9:00am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Don't. Find a different solution.
 
The problem is that the max length of a query string is not large, but it also isn't defined. IE has a maximum length of the entire URL + Query string of 2,083 characters http://support.microsoft.com/kb/208427[^] and that is characters, not bytes - since the URL and querystring are supposed to be human readable, you are looking at a lot less actual bytes than that!
 
The fact that you have to ask the question indicates that you have made a very wrong decision somewhere, and you need to go back and re-think your design a little. I can't suggest a "better way" because I have no idea why you think this is necessary in the first place!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Can you convert the bytes to a base64 string and try?
  Permalink  

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

  Print Answers RSS
0 BillWoodruff 330
1 Mathew Soji 309
2 Maciej Los 295
3 DamithSL 225
4 Afzaal Ahmad Zeeshan 217
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,025


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2014
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