Solved

Automatic URL encoding in flash

Posted on 2003-12-04
4
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.

695 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