Solved

Automatic URL encoding in flash

Posted on 2003-12-04
4
356 Views
Last Modified: 2007-12-19
I'm working with an RPC server which requires the HTTP post command to be sent like this:

Param1=http://192.168.1.63/a_gentone.htm&Param2=ON&Method=Net_PostHtmlData

but it keeps sending the data like this:
Param1=http%3A%2F%2F192%2E168%2E1%2E63%2Fa%5Fgentone%2Ehtm&Param2=ON&Method=Net%5FPostHtmlData

It's real nice that flash tries to make things easier by automatically url encoding everything, but there must be a way to disable this???

I can not change the way the RPC server works, there is no way for me to edit the way the server receives the data, I want to change the way flash sends it.

I'm going nuts trying to figure this one out. If anyone has ideas please let me know!

I've tried some stuff with unescape() and system.usecodepage = true but have not had any luck.
0
Comment
Question by:WebArchitect_Vince
  • 3
4 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
Comment Utility
Well, i think it's not a flash issue, as variables are send through http...
How does the RPC works? If it needs unencoded strings, but can receive an url as parameter, there should be a way already working..
(and not involving unencoding strings once arrived to the application)
0
 

Author Comment

by:WebArchitect_Vince
Comment Utility
This is just one of many problems I have with flash not sending the correct parameters. For example one application requires that I send a null string: %00

but Flash will not send it as %00:

myvars = new LoadVars();
myvars.Param1 = "%A5%01%00%01%00%01%03%00%01%00%01%00%00%90"
myvars.sendAndLoad("http://myserver/RPC", myvars, "POST")

When the server gets this string it looks like this:
Param1=%25A5%2501%2500%2501%2500%2501%2503%2500%2501%2500%2501%2500%2500%2590

The RPC server has no idea what to do with this, because it's all URL encoded.
So I try to use unescape()

on(press){
myvars = new LoadVars();
myvars.Param1 = unescape("%A5%01%00%01%00%01%03%00%01%00%01%00%00%90")
myvars.sendAndLoad("http://myserver/RPC", myvars, "POST")
}

The Flash only sends:
Param1=%C2%A5%01
 probably because unescape chokes when it gets to %00

What I want to do is have flash send the strings EXACTLY as I type them without changing them at all. I have a mini C++ application that lets me send post commands, and when I type the values %00%03..etc  everything works perfectly.
0
 

Author Comment

by:WebArchitect_Vince
Comment Utility
All I want to do is send a raw string through a post command. Flash wants to convert it to it's own URL friendly version but it MUST be sent exactly as i type it. Surely there must be a way to do this???
0
 

Author Comment

by:WebArchitect_Vince
Comment Utility
The solution was to recode the RPC server to tell it how many times to url decode the submitted data. so now when I send it %25%A5 it knows it should be using HEX A5 because it decodes it twice

Please close this question
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now