Solved

Automatic URL encoding in flash

Posted on 2003-12-04
4
368 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
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 live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.

737 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