View Full Version : Flash Remoting Question
I am trying the php remoting tutorial done by Jesse and keep getting a 'File Download' dialog box when testing the 'http://localhost/test_remoting/simple_gateway.php' in my browser. It appears I have all the dir paths correct though. Testing 'http://localhost/phpinfo.php' was successful, as well as testing 'http://localhost/flashservices/app/Gateway.php' in which I got a blank screen. If anyone could help me in what I'm doing wrong, it would be greatly appreciated.
CyanBlue
12-03-2003, 11:18 AM
Howdy and Welcome... ;)
Did you install PHP on your local machine and what is the version number of the PHP and AMFPHP you have???
That error message normally means that your local server(IIS or Apache) cannot understand the PHP page...
But then, you said that phpinfo.php file was successfully executed... So, probably you can read the PHP version out of that page for me... ;)
Another thing you might want to take a look is the directory sturucture of your AMFPHP files/directories... Go to the AMFPHP site and double check that you have the current version of AMFPHP and the file structure is the same as it is described in that place... ;)
Hi and thanks for the reply. I installed on my local machine(which is using IIS v5.1) the PHP version: 4.3.4 and MySQL Client API version 3.23.49. As for AMFPHP it was the 0.9.0 version. After downloading I extracted all the files into c\:inetpub\wwwroot\ creating the folder \flashservices.
CyanBlue
12-03-2003, 11:55 AM
Sorry, I can't really check if that's the correct settings or not cuz I just formatted the hard drive and in the process of installing whatever I can at the moment... :(
The setup sounds about right though... Maybe you might want to post the sample you have right now as exactly as possible so that somebody else can download and install it to see if there's anything wrong with the setup??? ;)
freddycodes
12-03-2003, 03:20 PM
Originally posted by kdkr
I am trying the php remoting tutorial done by Jesse and keep getting a 'File Download' dialog box when testing the 'http://localhost/test_remoting/simple_gateway.php' in my browser. It appears I have all the dir paths correct though. Testing 'http://localhost/phpinfo.php' was successful, as well as testing 'http://localhost/flashservices/app/Gateway.php' in which I got a blank screen. If anyone could help me in what I'm doing wrong, it would be greatly appreciated.
Thats by design, if you get the file download dialogue you are getting what you should. AMFPHP passes a amf mime type in the response headers. Regular browsers don't know what to do with them, thats why it asks you to download.
Anyways, the only real way to test the installation is to use flash. Are you running into any other problems.
Then that's allright. Thanks. No other problems, not as of yet, but I'm sure I will, being new to PHP. Thanks again for your reply.
CyanBlue
12-03-2003, 09:26 PM
Ah... Thanks freddy... :D
trytodream
04-23-2004, 01:46 AM
I have the same exact problem with everything opening up fine execpt for the download box opening on the simple_gateway.php
But when i run the flash code for that tutorial, it just gives me three lines in the trace window and thats it. So the PHP connection doesnt work.
Its says this in the NetConnection Debugger:
DebugId: 0
EventType: "Status"
MovieUrl: "file:///C|/phpdev/www/public/test_remoting/talk.swf"
Protocol: "http"
Source: "Client"
Time: 1082698986889
Date (object #1)
....."Fri Apr 23 15:43:06 GMT+1000 2004"
Status (object #2)
.....code: 256
.....description: "This user is not does not have access to returnString"
.....details: "c:\phpdev\www\flashservices\app\Executive.php"
.....level: "User Error"
.....line: 295
Anyone know what the problem could be?
thanks :)
Jesse
08-18-2004, 02:53 PM
I hear that removing the "roles" line from the method table resolves this issue.... Please try it and let me know. Credit to Sephiroth's site where I found this info...
jtubert
09-16-2004, 07:12 PM
yes that worked....
dialectical
10-07-2004, 02:15 AM
I've setup the entire flash remoting system on my local machine, php / mysql and i am using remoteDB, everything works great, I can read and post to the database. I am however, getting really, really bad lag when scrolling through signifigant amounts of text content which I would not normally get when using the exact same amount of text, in another flash application. It takes almost no time to load the entire post'ed data from mysql. The problem is in the scrollpane. Does anyone have insights to this? I'm not exactly sure if this whole actionscript.org board is going to get through, so if you've got the answer, the best way for me to get it is here:
<dialectical@gmail.com>
Thank you,
Dial.
I had the same problem (the roles line) - spent half an hour debugging - would suggest mentioning it in the article - changing the download source code. At least I was able to find the answer here without bugging Jesse. :) Thanks for the tutorial!
dialectical
10-10-2004, 02:56 AM
I am having a really bad problem with the php/mysql flash remoting stuff. I had mentioned earlier that the scrollpane for larger amounts of text (not much larger than a few paragraphs or so, actually) really, really slows things down much more than in your average flash movie, doing the same thing.
I think I might know why, and I really, really hope somebody here can help sort this out. I'm watching the trace on the 'result' coming in from the read.fla, its giving duplicates. Here is a mock-up example of what its doing in the trace:
Result Recieved: Blah blah of type object
(Results within object): Blah blah of type string
(Results within object): Blah blah of type string
Well, I'm not sure if i wrote that exactly right but, I hope somebody knows what I'm talking about, like I said, in the flash movie itself it doesnt seem to reveal this, but check in the trace on the call result back from php its doin doubles.
Anyway, I figured the multiple copies of these posts inside flash may be causing the lag in the scrollpane. Like I said, I hope somebody hears my cry!
Dial.
jondmac
10-28-2004, 08:48 PM
Is it some of this script that should be deleted?:
{
$credentials = &$this->_headerFilters['Credentials']['value'];
if (method_exists($this->_classConstruct, "_authenticate")) {
$roles = $this->_classConstruct->_authenticate($credentials['userid'], $credentials['password']);
if ($roles !== false) {
Authenticate::login($credentials['userid'], $roles);
} else {
Authenticate::logout();
} }
After deleting the above (in red), i got this from flash NetConnectio Debugger:
EventType: "Status"
MovieUrl: "file:///C|/apache/htdocs/test_remoting/talk.swf"
Source: "Client"
Time: 1098993649718
Date (object #1)
....."Thu Oct 28 22:00:49 GMT+0200 2004"
Status (object #2)
.....code: "NetConnection.Call.BadVersion"
.....description: ""
.....details: ""
.....level: "error"
I realy cant find out what lines to delete!
Please HELP!
glasses248
10-29-2004, 11:59 PM
Yah, I had the same problem. It would complain about userRole error or returnString Error.
I went to Executive.php and looked at the function checkRole in the line 291 to 298. So i commented the following:
function checkRoles () {
/*
if(isset($this->methodrecord['roles'])) {
if(!Authenticate::isUserInRole($this->methodrecord['roles'])) {
trigger_error("This user is not does not have access to " . $this->_methodname, E_USER_ERROR);
}
}*/
}
This way we can preserve the original code.
Than you also have to look at line 210 to 219 which is about function loadServiceClass Than I comment the following:
function loadServiceClass ()
{
$this->_calledMethod = $this->_methodname;
$fileExists = @include_once($this->_classpath); // include the class file
if($fileExists && class_exists($this->_classname)) { // Just make sure the class name is the same as the file name
chdir(dirname($this->_classpath)); // change the cwd to the to the dir with the class
} else { // Class not found exception
// trigger_error("no class named " . $this->_classname . " is known to the gateway", E_USER_ERROR);
}
}
After that i followed Jesse's tutorial and everything went groovy as he mentioned. I'm still following the tutorial, and I hope this is the correct way to fix the errors, cause it might cause future errors...
P.s. You might want to check that you have the latest version at http://amfphp.sourceforge.net/
......................
I did a little more research about this error and come to realize, that the above comments out the authenication part. Plus it use E_USER_ERROR to stop the Executive.php from proccessing through it and halts your fla. Since its on your localhost i don't think you will need to implement an authenication... at least not yet...
But if you do need to use authenication, check this link http://www.sephiroth.it/tutorials/f...ion/page004.php Its the tutorial on how to use amfphp and it teaches how to use the authenication. Don't forget to uncomment the above.
I hope this helps.
primus
01-15-2005, 06:39 PM
I hear that removing the "roles" line from the method table resolves this issue.... Please try it and let me know. Credit to Sephiroth's site where I found this info...
I have just the exact error "User error line 295"
I deleted all 3 lines "roles" => "role, list" in talkback.php but it didn't help.
Don't even know what to do. Please help me!
primus
barta
01-28-2005, 09:57 AM
Glasses,
Your solution works fine!!!
Thx!!!
chantaimanchris
07-21-2005, 09:12 AM
I went to Executive.php and looked at the function checkRole in the line 291 to 298. So i commented the following:
I am using amfphp 1.0. I could find Executive.php in the app folder yet I couldn't locate those lines to be commented. There are 97 lines in my Executive.php.
Could anyone help? I'm also trying out the same tutorial and when I test talk.fla, it printed only the three lines listed below.
Calling returnString
Calling returnNumber
Calling returnArray
I've been trying out Remoting with Flash MX 2004 for many days yet I can't finish the tutorial.
Thanx a lot,
Chris
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.