Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » url-encoded binary data in URL query string - how to decode properly?
url-encoded binary data in URL query string - how to decode properly? [message #40414] Wed, 31 July 2013 09:55 Go to next message
Peter is currently offline  Peter
Messages: 16
Registered: October 2012
Promising Member
Hi.

I'm facing the following problem. Suppose I have a binary file which I want to send via a http GET request in a URL. Before transfer, the raw data must be Base64 encoded.

Suppose I have the following url:

http://myhost.com/path/?data=...

Where ?data=... is the URL query string with Base64 encoded binary data after "=" character.

Now suppose I have a Skylark handler for "/path". Binary data (still Base64 encoded) can be accessed on server side by http["data"].ToString(), but there's a problem. The resulting string is not the same as the original one: all "+" characters from original string become " " (space) characters. I know this is due to the fact that spaces in url query strings are encoded by plus characters, but what about two other potentially "dangerous" characters, particularly "/" and "=" (padding indicator) appearing in Base64 encoded strings? Will they be substituted either?
Re: url-encoded binary data in URL query string - how to decode properly? [message #40452 is a reply to message #40414] Sat, 03 August 2013 09:05 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Peter,

Passing base64 data in GET parameter is not a good idea, in any framework. What you need is to urlencode the data before you send them, then they should arrive just OK in the Skylark handler.

Best regards,
Honza
Previous Topic: Some additions to Skylark
Next Topic: Need a working simple example of using sockets with GUI in U++
Goto Forum:
  


Current Time: Tue Apr 23 13:49:42 CEST 2024

Total time taken to generate the page: 0.02137 seconds