AndrewSimm
Well-known member
I have a script that I created in PHP and am trying to convert to work within XF2. One area where I am stuck is understanding how XF2 writes files. Basically, I have a web form where the user can select an image. Below is the PHP I currently use. Is there a different way I should be doing this in XF2?
PHP:
//This is the directory where images will be saved
$target = "/home/***/public_html/player/photos/".$player_id."/";
$target = $target . basename( $_FILES['photo']['name']);
if(!is_dir("/home/***/public_html/player/photos/".$player_id."/")) {
mkdir("/home/***/public_html/player/photos/".$player_id."/");
}
//Writes the photo to the server
move_uploaded_file($_FILES['photo']['tmp_name'], $target);