# Flash php image upload-change image name

**URL:** <https://forum.kirupa.com/t/flash-php-image-upload-change-image-name/200390>\
**Category:** Uncategorized\
**Created:** [September 11, 2006, 9:25pm UTC](https://forum.kirupa.com/t/flash-php-image-upload-change-image-name/200390 "2006-09-11T21:25:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phastings](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phastings](https://forum.kirupa.com/u/phastings)\
**Post date:** [September 11, 2006, 9:25pm UTC](https://forum.kirupa.com/t/flash-php-image-upload-change-image-name/200390/1 "2006-09-11T21:25:37Z")

</div>

hi,  
i’m not really a php guy and was hoping someone could help me out with this. i have a from that is called from flash that uploading an image(from flash 8). what i want it to do is change the name of the image file file before uploading/moving the file and have that new file name returned to flash. i think all of this can be done on the php side before flash even gets the file name but i’m not positive about that. here’s the php code:

\<?php  
//create the directory if doesn’t exists (should have write permissons)  
if(!is\_dir("./files")) mkdir("./files", 0755);  
//move the uploaded file  
move\_uploaded\_file($\_FILES[‘Filedata’][‘tmp\_name’], “./files/”.$\_FILES[‘Filedata’][‘name’]);  
chmod("./files/".$\_FILES[‘Filedata’][‘name’], 0777);  
?\>

i figure that the name could be changed before the move\_uploaded\_file is called but i’m not sure how to do it.

thanks in advance for the help.
