Solved

Automatic URL encoding in flash

Posted on 2003-12-04
4
364 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
ID: 9912744
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
ID: 9912943
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
ID: 9973639
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
ID: 10624764
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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 what frame rate is, how to control it and what effect it has on the video.

809 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