# Convert php to asp

**URL:** <https://forum.kirupa.com/t/convert-php-to-asp/295111>\
**Category:** Uncategorized\
**Created:** [August 25, 2009, 1:48pm UTC](https://forum.kirupa.com/t/convert-php-to-asp/295111 "2009-08-25T13:48:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kayyali](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@kayyali](https://forum.kirupa.com/u/kayyali)\
**Post date:** [August 25, 2009, 1:48pm UTC](https://forum.kirupa.com/t/convert-php-to-asp/295111/1 "2009-08-25T13:48:57Z")

</div>

Dear,  
i am using upload files from flash and php and need it to be \*\*asp \*\*as my client server didn’t support php only asp

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);  
?\>

actionscript code:  
//Allow this domain  
System.security.allowDomain(“[http://localhost/](http://localhost/)”);  
import flash.net.FileReference;  
var listener:Object = new Object();

listener.onSelect = function(selectedFile:FileReference):Void {  
selectedFile.upload(“upload.php”);  
};

var imageFile:FileReference = new FileReference();  
imageFile.addListener(listener);

uploadBtn.onPress = uploadImage;  
imagePane.addEventListener(“complete”, imageDownloaded);

function uploadImage(event:Object):Void {  
imageFile.browse([{description: “Image Files”, extension: “_.jpg;_.gif;\*.png”}]);  
}
