Man I didn't even think of that, thanks guys, very helpful.

Jim

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Rhodes
Sent: 05 March 2006 20:04
To: Flashcoders mailing list
Subject: Re: [Flashcoders] FileReference upload, change file name

jim wrote:
> I only need the ability to change the name of the file that is being
> uploaded. How would I go about this? I tried changing the [FileReference
> instance].name field but this is read only. On the php side I am not sure
if
> I can pass through other data with the file data.
I did this with the php file...

<?php
if ($_FILES['Filedata']['name']) {
   $uploadDir = $_REQUEST['dir']."/";
   $uploadFile = $uploadDir . basename($_REQUEST['fileName']);
   $uploaded = move_uploaded_file($_FILES['Filedata']['tmp_name'], 
$uploadFile);
   echo $uploaded;
}
?>

and the line in the flash like so...

file.upload("../../assets/php/uploadFile.php?fileName=" + theFileName + 
"&dir=" + theDir

this way i was controlling the directory the files went into and the 
filenames of the uploaded files from the flash rather than the php.

hth,

tom.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to