FileReference doesn't work with PHP Globals

<help>,
Ok so this is my problem. I have a flash movie that allows
users to uploads two images to a server. What I'm trying to do is
have the uploaded images go directly to their user's directory. I
need the upload.php file to figure out which person is uploading an
image. The php page that handles the file uploads will not read in
any global variables (i.e. POST, GET, SESSION, COOKIE). Also
FileReference.upload() doesn't allow you to send any GET / POST
vars along with it (as far as I have tested and read about). I've
been working on this for four days now and have concluded it's
something to do with the Flash FileReference calling the php page.
I believe for some reason when FileReference calls the php page the
web server doesn't like/allow/understand how the page is called so
it denies any global var requests. I know its flash because it
works if I use an html front end with the same php uploader page.
So the goal for you 'out of the box' thinkers is to get one
single darn global variable pulled into the php upload page. The
ONLY way I can think of doing this is when every time a user
creates an account and their folder is created, it copies the php
upload file their directory. Then in flash when a user needs to
upload its calls the upload file in each persons upload directory.
Needless to say I do not want to do it this way but I'm running out
of ideas.
P.S. someone has suggested uploading the images to a temp
file name and then immediatly move the image to the users folder
but I I'm tentive to do it that way since you could get two people
uploading at the same time and one person would get the second
person's image and the second person would get an error.
<!--- actionscript code
this._fileRef.upload("upload.php"); <---- works
this._fileRef.upload("upload.php?user_id=4"); <---- does
not work
//-->
<?php
session_start();
$user_id = $_SESSION['user_id']; // Does not work
$user_id = $_COOKIE['user_id']; // Does not work
$user_id = $_GET['user_id']; // Does not work
$user_id = $_POST['user_id']; // Can't do with FileReference
class
?>
</help>

This may help. You can pass some URL encoded data with the
FileReference
upload method.
file_fr.upload("upload.php?testvar=Hello World " +Date());
Then this is a demo on how you can see that data, which you
would need to
rework to use to set the path.
<?php
if ($_FILES['Filedata']['name']) {
$uploadDir = "images/";
$uploadFile = $uploadDir .
basename($_FILES['Filedata']['name']);
move_uploaded_file($_FILES['Filedata']['tmp_name'],
$uploadFile);
$filename = "output.txt";
$fp = fopen( $filename,"w+");
fwrite ( $fp, "Test" );
fwrite ( $fp, $_REQUEST['testvar'] );
fclose( $fp );
?>
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
"Webmaster Pete" <[email protected]> wrote
in message
news:[email protected]...
> <help>,
>
> Ok so this is my problem. I have a flash movie that
allows users to
> uploads
> two images to a server. What I'm trying to do is have
the uploaded images
> go
> directly to their user's directory. I need the
upload.php file to figure
> out
> which person is uploading an image. The php page that
handles the file
> uploads
> will not read in any global variables (i.e. POST, GET,
SESSION, COOKIE).
> Also
> FileReference.upload() doesn't allow you to send any GET
/ POST vars
> along
> with it (as far as I have tested and read about). I've
been working on
> this for
> four days now and have concluded it's something to do
with the Flash
> FileReference calling the php page. I believe for some
reason when
> FileReference calls the php page the web server doesn't
> like/allow/understand
> how the page is called so it denies any global var
requests. I know its
> flash
> because it works if I use an html front end with the
same php uploader
> page.
>
> So the goal for you 'out of the box' thinkers is to get
one single darn
> global variable pulled into the php upload page. The
ONLY way I can think
> of
> doing this is when every time a user creates an account
and their folder
> is
> created, it copies the php upload file their directory.
Then in flash when
> a
> user needs to upload its calls the upload file in each
persons upload
> directory. Needless to say I do not want to do it this
way but I'm running
> out
> of ideas.
>
> P.S. someone has suggested uploading the images to a
temp file name and
> then
> immediatly move the image to the users folder but I I'm
tentive to do it
> that
> way since you could get two people uploading at the same
time and one
> person
> would get the second person's image and the second
person would get an
> error.
>
> <!--- actionscript code
> this._fileRef.upload("upload.php"); <---- works
> this._fileRef.upload("upload.php?user_id=4"); <----
does not work
> //-->
>
> <?php
> session_start();
> $user_id = $_SESSION['user_id']; // Does not work
> $user_id = $_COOKIE['user_id']; // Does not work
> $user_id = $_GET['user_id']; // Does not work
> $user_id = $_POST['user_id']; // Can't do with
FileReference
> class
> ?>
>
> </help>
>

Similar Messages

  • How to configure OCI of Oracle9i to work with PHP or ASP on IIS5

    I've been trying to make OCI of Oracle9i to work with PHP for all week. I went thourgh millions of documents and forums. And I still can't make them work. Anyone, please help me.
    I used to have Oracle8i on my machine and it worked fine with both PHP and ASP on IIS5. Then I decided to change to Oracle9i. So I install Oracle9i in seperate home. And they worked fine. But one day I couldn't access some of my websites via "localhost/mywebsite". And I thought there is something wrong with IIS coz I ran very huge queries. So I reinstall IIS5. Then everything crash. PHP and ASP can't work with OCI. So I uninstalled every Oracle component (database and services) and PHP out of my machine. Then I installed Oracle9i database, redownload "php-4.3.1-installer.exe" , and install PHP.
    Since I can't seem to find "php_oci8.dll" in "c:\php\" after I installed, I assume that oracle9i must provide OCI and I found the file "oci.dll" in "c:\OraHome9\Bin" directory. So I changed the extension directory in php.ini to
    extension_dir = "c:\OraHome9\Bin"
    And it still doesn't work. I'm kinna new to ASP so I don't know how to fix this problem.
    Anyone, would you please give me any suggestion how to solve this problem or where to find the solution for this problem? I'd be very appreciated.

    I've been trying to make OCI of Oracle9i to work with PHP for all week. I went thourgh millions of documents and forums. And I still can't make them work. Anyone, please help me.
    I used to have Oracle8i on my machine and it worked fine with both PHP and ASP on IIS5. Then I decided to change to Oracle9i. So I install Oracle9i in seperate home. And they worked fine. But one day I couldn't access some of my websites via "localhost/mywebsite". And I thought there is something wrong with IIS coz I ran very huge queries. So I reinstall IIS5. Then everything crash. PHP and ASP can't work with OCI. So I uninstalled every Oracle component (database and services) and PHP out of my machine. Then I installed Oracle9i database, redownload "php-4.3.1-installer.exe" , and install PHP.
    Since I can't seem to find "php_oci8.dll" in "c:\php\" after I installed, I assume that oracle9i must provide OCI and I found the file "oci.dll" in "c:\OraHome9\Bin" directory. So I changed the extension directory in php.ini to
    extension_dir = "c:\OraHome9\Bin"
    And it still doesn't work. I'm kinna new to ASP so I don't know how to fix this problem.
    Anyone, would you please give me any suggestion how to solve this problem or where to find the solution for this problem? I'd be very appreciated.

  • Trying to load illustrator 6cs onto new mac and the old activation code for my ill cs doesn't work with it

    Trying to load a downloaded version of illustrator 6cs onto new mac and the old activation code for my illustrator cs doesn't work with it.  Do I need a new code or am I missing something?  Same goes for my Photoshop cs.

    you need your serial number.
    if you purchased from or registered with adobe check your account, https://www.adobe.com/account.html

  • Cinema Display (clear) with DVI/ADC box doesn't work with MacBook Pro

    Cinema Display (clear) with DVI/ADC box doesn't work with MacBook Pro when plugged in with a dvi to mini dvi cable. Any ideas what to do to make it work? I lugged the 23" 2500 miles into the wilderness and I need help

    Okay, here's an update: the DVI to ADC adapter does work with the Apple displays that I have tried, but it won't work with the Formac. I have tried multiple time to contact them, but to no avail... they don't even respond to threats of posting my opinion of them, which is this:
    DON'T BUY ANYTHING FROM FORMAC! They make quality products, but their customer service is a big time joke! They won't take care of you.

  • HT201210 hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    Try the suggestions here to see if they resolve your problem:
    http://support.apple.com/kb/ts1559
    If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.

  • TS1253 I have a printer epson TX210, but it doesn't work with my time-capsule. What need to do?

    I have a printer epson TX210, but it doesn't work with my time-capsule. What need to do?

    What have you tried?
    You are going to get nowhere quick with the 6.1 utility in Mountain Lion if this is the only OS you have available.
    Look up how to install 5.6 utility under ML. At least then you can see printers. That is assuming you are trying to use USB.
    Has this worked ever on Mountain Lion? Did you download the drivers for that printer for ML?
    Plug it into a computer directly.. does it work? If it doesn't work locally it sure will not work via the network.

  • My i pod nano first generation doesn't work with windows 8

    My i pod nano first generation doesn't work with windows 8

    Howdy yvesmd,
    Thanks for using the Apple Support Communities.
    If your iPod nano is not being recognized in iTunes on your Windows computer, then I'd like you to please follow the directions in the link below.
    Apple - Support - iPod - iPod nano Troubleshooting
    Cheers,
    Alex H.

  • Quicklook doesn't work with .avi files

    Hello, i've got a little problem right here on my mac. The thing is that I used to have Snow Leopard as a OS and quicklook used to work great, it opened all the extensions I used to work with. The thing change when I format my HDD and installed a clean copy of Lion OS. Now quicklook works fine as it used to but not any more with .avi files. I remember that this feature was working great on my previous OS, and it's really important for me to find a solution because quicklook is an absolutely amazing feature of our Macs.
    I've tryed to download plugins, restoring permissions or even trying it with a guest user, but no success.
    Please help me. If you need more info about specs or something i'll be glad to give them to you.
    Thank you!!!

    Also doesn't work with Grapher (.gcx) documents (an Apple format).

  • The Bluetooth on my 2012 Lexus doesn't work with my iPhone 5.  My old android phone worked perfectly with my car.  Even the tech guy at Lexus couldn't get it to work.  What is apple doing to fix this.

    The Bluetooth on my 2012 Lexus doesn't work with my iPhone 5.  My old android worked perfectly with my car.  Even the tech specialist at Lexus couldn't get it to work.  Lexus said that other iPhone 5s were having the same problem.  What is apple doing to fix this?

    Going to the local Apple store this morning...
    My problem is not uncommon as the board is showing signs of this happening to many others as well. That is where I found the restore and reboot information to try to solve the issue of crashing apps.
    I understand that Apple will not "give away the cow", but letting iPhone users know that the problems they are having are being addressed by Apple is a little more comforting than nothing at all. Other wise, all the apps in world are useless and even more importantly worthless, if a person has to reset/reboot/reload just to get them to work.
    IF Apple can not address the basic problems with todays iPhone apps, why should one believe that the iPhone 3.0 OS is any better? Using a PC comparison, which is better, XP or Vista. If the current iPhone OS of 2.2. what ever is not working that well (as related to down loaded apps and iTunes), will OS 3.0 be any better?
    The waste of time I refer to is in going to the apps store and downloading the apps... Again why by apps if the free version does not work?

  • Satellite M40-129: PCMCIA Card doesn't work with Linux

    I have D-Link DWL-G650 with Atheros Chipset which is good supported under linux (madwifi). But if I boot Linux the card is not found. I tested the card with an Fujitsu Siemens Notebook and it worked out of the box!
    Any idea why it doesn't work with my M40-129 ?

    Hi
    Like you know Toshiba doesnt support the Linux and there are no Toshiba drivers for the Linux OS but I was able to find this useful Toshiba page about the notebook configuration with Linux:
    http://newsletter.toshiba-tro.de/main/
    You should check the OS machine compatibility and the other areas.
    Im sure you will find many useful tips.
    Good luck

  • HT5706 I am trying to set up Apple TV with my Uverse WiFi, but I get errors when entering my password.  One site said that Apple TV doesn't work with WPA which Uverse uses.  Is there anyway around this or will Uverse and Apple TV just not work together.

    Trying to set up Apple TV with ATT Uverse.  I get errors when trying to enter my WiFi password.  One site says that Apple TV doesn't work with Uverse because it uses WPA for encryption.  If true, does that mean Uverse subscribers cannot use Apple TV?

    Spurs63 wrote:
    does that mean Uverse subscribers cannot use Apple TV?
    No, that's a rather silly conclusion.
    There are two options:
    stop using the crappy router provided by the ISP.
    Physically connect the ATV to the router via Ethernet.

  • My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    Please explain.
    What does "cellcom line doesn't work with my iPhone" mean?
    What are you trying?  What is happening?
    Where did you buy the iphone?
    Any info abnout your issue at all?

  • Media Encoder CS4 doesn't work with Premiere (pic related)

    Oh hai!
    I just got Adobe Master Collection CS4 and my Media Encoder doesn't work with Premiere CS4. When I try to export the file, Encoder starts normally. Then I click "Start queue" and Encoder starts loading. Loading takes almost five minutes, which is a long time, because my project is very simple. After that nothing happens, just a warning sign appears. When I click it open, some kind of log file open and it says:
    Encoding failed
    Could not read from the source. Please check if it has moved or been deleted.
    And I didn't deleted anything. So what does that mean? Why that "Source Name's" path is different than my project files path? Can this problem relate that somehow?
    I have also another problem with Premiere CS4, maybe there's a link between these two problems. I can't get Premiere projects linked to open in Premiere CS4. When I right-click the project icon, and click “Open with…”, I can't find Premiere from the list. When I click "Browse", I can find Premiere.exe from my computer, but if i doubel-clicked it, nothing happens. It won't appear to the list or anywhere else. Or have I missed something? So now the project files are linked to open in After Effects. Of course I can open projects from Premiere, but how do I get them open straight from file?
    I have long experience using Adobe Premiere and this is the first time I got this kind of problems. I have also downloaded new updates for Premiere and Encoder, this didn't help. Does that matter, that I didn't installed Premiere in C-drive? However it's in my computers internal drive, I have divided my hard drive for five parts, one part contains all of my softwares. My scratch disks are in different hard drive (external), does that matter? I tried different location, but that didn't help.
    Please help, I can't do any video editing, because of this problem. And sorry for my english, ask if you didn't understand something. =)

    Hello, this is terrible problem, which i found in CS 6 softwares ...
    solution i found only working, is uninstall and reinstall full package.. but it is not all,
    you need to do BRAND NEW admin account in windows, and install it there.
    that means, i could not export after repair from encoder in my original account never more (!!)   .. this is really terrible way how to repair this issue, because :
    1.by reinstalling of software, client WASTE HIS TIME
    2.by necessity to begin work in another windows profile you again WASTE YOUR TIME because of learning and migrating all other profile modifications, which i see really unaccpetable. Adobe means, this solution of repair is ok, and they did not do till today any steps of creating some "clever" solution.
    I ask everybody, who will meet this issue in future, guys, please, complain about this situation, give "BUG Report" to them, and write "feature request" to them , in the way of creating some repair tool, which check actual  "broken" connections between encoder and premiere, which refuses to "take material" from it and encode, and REPAIR it automatically..  
       I am not IT, but ..does it seems so hard to create this ? Adobe IT developers should know their systems, and should create such utility tool really easy.
    History of this problem and detailed description, HOW i did "repair" this. With wasting of app 2,5 days of my working time :
    1. after repairing "error 5" problem , i solved it by reinstalling the suite from the new admin user profile (profile B) . 
    I continued my work on my normal working windows profile . (profile A)
    Every cooperation (AE+Pr, export media via "queue" to Encoder) was working fine . . .
    2. suddenly it stop working (without knowing any possible reason - i did not do installations )
    and showed in error export log file :
    "Could not read from the source. Please check if it has moved or been deleted."
    3.repair via procedure(procedure "a"):
    i did this procedure on the profile B (profile from last time installation of repairing problem error 5)
    I did these steps :
    a-uninstall master coll suite
    b-i used Adobe cleaner tool (remove ALL)
    c-removed raw directories in locations
    •C:\Program Files\Adobe
    •C:\Program Files(x86)\Adobe
    •C:\Program Files\Common Files\Adobe
    •C:\Program Files(x86)\Common Files\Adobe
    •C:\ProgramData\Adobe
    d-removed these links from registry file
    •HKEY_LOCAL_MACHINE\SOFTWARE\Adobe
    •HKEY_CURRENT_USER\Software\Adobe
    •HKEY_LOCAL_MACH INE\SOFTWARE\Wow6432Node\Adobe
    •HKEY_CURRENT_USER \Software\Wow6432Node\Adobe
    e-restarted the PC
    f- newly installed the Master Coll CS6
    g-update the software
    result of repair of "3" : problem still exists
    4.Ok i find out after coordination with support, it should have been created  ANOTHER NEW admin account.
    4a:so i did the same procedure (uninstalling) in profile B
    4b: and then i created brand new admin profile (profile C)for INSTALLATION of software
    4c: restarted the pc (and did not updated it yet)
    result :
    ==exporting of any sequence/raw/AE link video material from premiere via "queue" (Encoder) (profile C) : export WORKS
    ==exporting of any sequence/raw/AE link video material from premiere via "queue" (Encoder) (profile B) : export WORKS
    ==exporting of any sequence/raw/AE link video material from premiere via "queue" (Encoder) (profile A) : export DOES NOT WORK ! ! !
    (in profile A, is possible to export some raw video material in encoder which is imported to it via "drag and drop)
    problem i see:, i have my basic profile A, which i am interested to work, because of all my directory modifications are in there..
    this issue should be some "broken" connections between encoder and premiere, which refuses to "take material" from it and encode.
    what i expect :
    to get from Adobe some repair tool, which automatically checks these connections and repair if necessary, without necessity of founding the new profile and reinstallation of whole software.. this is madness !
    what i do NOT expect from Adobe:
    to get from Adobe advice of kind : you have to reinstall full software in new admin profile. sorry , we do not know the solution, because we do not know, how do behave our software.

  • Apple tv mirroring doesn't work with ipad 2

    Apple tv mirroring doesn't work with ipad 2 and last update achieved

    you have to be sure that you have iOS 4.4 on your Apple TV. Apple pulled 4.4 due to problems and hasen't re-released it yet. the only way now is to hook it up to your computer with a micro USB cable and then in iTunes you should see your Apple TV and do a restore and it will then put 4.4 on the Apple TV but it will wipe out all your settings and you will have to do all that over again but mirroring will then work.

  • Apex 4.2 pre-prod Theme 50 doesn't work with BlackBerry 6.0

    The theme 50 in the pre-pod 4.2 on apex.oracle.com doesn't work with BlackBerry version 6.0. Input fields turn black with black when they get focus
    This is a Jquery Mobile bug.
    See
    http://stackoverflow.com/questions/11870842/how-to-fix-a-blackberry-browser-input-from-going-black-on-focus
    https://github.com/jquery/jquery-mobile/issues/4828
    https://github.com/jquery/jquery-mobile/issues/4836
    Any chance of implementing a work around or patching JQM?

    Putting the second suggestion at Stack Overflow into the in-line CSS seems to have done the trick.
    .ui-btn.ui-focus, .ui-input-text.ui-focus, ui-input-search.ui-focus {
    outline: none;
    -webkit-box-shadow: none;
    There is still an issue that when a link is selected it show the same behaviour but that's more liveable with and I haven't given up hope of finding the class which is causing it.
    The JQM guys look like they have a solution too but I couldn't work out which version it would be applied to.

Maybe you are looking for

  • Error While activation of transformation

    HI All Gurus, I created transformation. i maped KZW1 ( CURR - 13 ) WITH 0SUBTOT_1S ( CURR - 9) AND WAERK (CUKY - 5) WITH 0STAT_CURR ( CUKY - 5). Same with KZW2, KZW3, KZW4, KZW5 And KZW6. bUt when i going to activete the error comes like Rule 24 (tar

  • Print out of drawing and QA instructions along with PO

    Hi Gurus, I have a requirement of printing the material drawing and the Quality instructions along with the PO print out. Material drawing is to be sent to the vendor and Quality inspection instructions to the stores. I am updating these documents in

  • How do I get remove unwanted RAID slices?

    I have two 300GB firewire drives. I have them configured as a mirrored RAID set. One drive failed and the RAID volume went into a degraded status. I replaced the drive, peformed a rebuild, and the drive is part of the the mirrored RAID set again and

  • Computer shuts down when i unplug it!

    My MacBook Pro is only 7 months old and in the corner the battery says 95% available (plugged in, not charging) but when i unplug it, it shuts down on me. Do i need a new battery?

  • Execute system command line instructions

    Hi, suppose that my java program has to execute a system command line instrction(let's say dir/p for dos or ls * f or linux) how can we execute these system command line instructions programmatically from within a java program? thanks indeed for help