-
Senior Member
FileReference.upload method, extra variable?
hi,
im using the FileReference.upload method to upload a file to a php script, only thing is I want to also an extra variable (the directory where the file is to be put) to the php script, but don't see how to include that, how do I do that?
thanks for any advice.
boombanguk
-
Senior Member
PHP Code:
//path to folder
$folder= 'text';
//path name of file for storage
$uploadfile = "$folder/" . basename( $_FILES['Filedata']['name'] );
//if the file is moved successfully
if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
success("The file was successfully uploaded.");
}
- The right of the People to create Flash movies shall not be infringed. -
-
Senior Member
thats php code right? what I need is how do I send that $folder variable FROM flash to the php code when I do the upload comand?
-
Senior Member
You can't. You need to do it over php. Flash will put your file where the movie is located.
- The right of the People to create Flash movies shall not be infringed. -
-
Bearded (M|G)od
you could always append the folder name to the end of the upload method like so:
FileReference.upload("myscript.php?folder=/folder1/folder2/");
then in PHP, use the $_GET['folder'] to retrieve that folder information.
-
Senior Member
Originally Posted by cancerinform
You can't. You need to do it over php. Flash will put your file where the movie is located.
I probably didn't explain myself well, as I just did "upload.php?file=whatever" and it worked fine. But I was hoping I could send a variable actually from WITHIN flash with the upload method. That seems to me a bit of a miss from adobe, as what if I need to send variables with the upload (and I don't want to use ?file=).....thats what I love about loadVars.
-
Senior Member
MyFriendIsATaco gave you the best solution, did not know it
You cannot send anything using LoadVars to the php file.
- The right of the People to create Flash movies shall not be infringed. -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|