?
Solved

Automatic URL encoding in flash

Posted on 2003-12-04
4
Medium Priority
?
371 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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

741 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